Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GitLab Drupal CI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Docker
GitLab Drupal CI
Commits
111c7a57
Commit
111c7a57
authored
6 years ago
by
jurgenhaas
Browse files
Options
Downloads
Patches
Plain Diff
Build image from scratch based on alpine:3.7 to get PHP version 7.1
parent
9f139ec0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#5834
passed
6 years ago
Stage: build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Dockerfile
+54
-5
54 additions, 5 deletions
Dockerfile
docker-entrypoint.sh
+30
-0
30 additions, 0 deletions
docker-entrypoint.sh
modprobe.sh
+20
-0
20 additions, 0 deletions
modprobe.sh
with
104 additions
and
5 deletions
Dockerfile
+
54
−
5
View file @
111c7a57
FROM
docker:18.06.1
FROM
alpine:3.7
LABEL
com.example.vendor="
PARAGON Executive Service GmbH
" \
maintainer="juergen
@paragon-es.de
" \
version="1.
1
.0" \
LABEL
com.example.vendor="
LakeDrops
" \
maintainer="juergen
.haas@lakedrops.com
" \
version="1.
2
.0" \
description="An image for GitLab runner to build and test Drupal projects."
ARG
compose_version=1.21.2
ARG
glibc_version=2.28-r0
RUN
apk add
--no-cache
\
ca-certificates
# set up nsswitch.conf for Go's "netgo" implementation (which Docker explicitly uses)
# - https://github.com/docker/docker-ce/blob/v17.09.0-ce/components/engine/hack/make.sh#L149
# - https://github.com/golang/go/blob/go1.9.1/src/net/conf.go#L194-L275
# - docker run --rm debian:stretch grep '^hosts:' /etc/nsswitch.conf
RUN
[
!
-e
/etc/nsswitch.conf
]
&&
echo
'hosts: files dns'
>
/etc/nsswitch.conf
ENV
DOCKER_CHANNEL stable
ENV
DOCKER_VERSION 18.06.1-ce
# TODO ENV DOCKER_SHA256
# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !!
# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though)
RUN
set
-eux
;
\
\
# this "case" statement is generated via "update.sh"
apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
x86_64) dockerArch='x86_64' ;; \
armhf) dockerArch='armel' ;; \
aarch64) dockerArch='aarch64' ;; \
ppc64le) dockerArch='ppc64le' ;; \
s390x) dockerArch='s390x' ;; \
*) echo >&2 "error: unsupported architecture ($apkArch)"; exit 1 ;;\
esac; \
\
if ! wget -O docker.tgz "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz"; then \
echo >&2 "error: failed to download 'docker-${DOCKER_VERSION}' from '${DOCKER_CHANNEL}' for '${dockerArch}'"; \
exit 1; \
fi; \
\
tar --extract \
--file docker.tgz \
--strip-components 1 \
--directory /usr/local/bin/ \
; \
rm docker.tgz; \
\
dockerd --version; \
docker --version
COPY
modprobe.sh /usr/local/bin/modprobe
COPY
docker-entrypoint.sh /usr/local/bin/
ENTRYPOINT
["docker-entrypoint.sh"]
CMD
["sh"]
RUN
mkdir
-p
/root/.ssh
&&
\
echo
"StrictHostKeyChecking no"
>>
/root/.ssh/config
&&
\
\
apk update
&&
\
apk add
--no-cache
curl openssl openssh ca-certificates wget make patch
\
bash fish python nodejs
npm
git unzip
\
bash fish python nodejs git unzip
\
php7 php7-phar php7-json php7-dom php7-gd php7-mbstring php7-openssl
\
php7-pdo php7-curl php7-xml php7-zip php7-session php7-ctype
\
php7-tokenizer php7-simplexml php7-xmlwriter
&&
\
...
...
This diff is collapsed.
Click to expand it.
docker-entrypoint.sh
0 → 100755
+
30
−
0
View file @
111c7a57
#!/bin/sh
set
-e
# first arg is `-f` or `--some-option`
if
[
"
${
1
#-
}
"
!=
"
$1
"
]
;
then
set
--
docker
"
$@
"
fi
# if our command is a valid Docker subcommand, let's invoke it through Docker instead
# (this allows for "docker run docker ps", etc)
if
docker
help
"
$1
"
>
/dev/null 2>&1
;
then
set
--
docker
"
$@
"
fi
# if we have "--link some-docker:docker" and not DOCKER_HOST, let's set DOCKER_HOST automatically
if
[
-z
"
$DOCKER_HOST
"
-a
"
$DOCKER_PORT_2375_TCP
"
]
;
then
export
DOCKER_HOST
=
'tcp://docker:2375'
fi
if
[
"
$1
"
=
'dockerd'
]
;
then
cat
>
&2
<<-
'
EOW
'
📎 Hey there! It looks like you're trying to run a Docker daemon.
You probably should use the "dind" image variant instead, something like:
docker run --privileged --name some-overlay-docker -d docker:stable-dind --storage-driver=overlay
See https://hub.docker.com/_/docker/ for more documentation and usage examples.
EOW
sleep
3
fi
exec
"
$@
"
This diff is collapsed.
Click to expand it.
modprobe.sh
0 → 100755
+
20
−
0
View file @
111c7a57
#!/bin/sh
set
-eu
# "modprobe" without modprobe
# https://twitter.com/lucabruno/status/902934379835662336
# this isn't 100% fool-proof, but it'll have a much higher success rate than simply using the "real" modprobe
# Docker often uses "modprobe -va foo bar baz"
# so we ignore modules that start with "-"
for
module
;
do
if
[
"
${
module
#-
}
"
=
"
$module
"
]
;
then
ip
link
show
"
$module
"
||
true
lsmod |
grep
"
$module
"
||
true
fi
done
# remove /usr/local/... from PATH so we can exec the real modprobe as a last resort
export
PATH
=
'/usr/sbin:/usr/bin:/sbin:/bin'
exec
modprobe
"
$@
"
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment