Skip to content
Snippets Groups Projects
Commit 6e71cc80 authored by jurgenhaas's avatar jurgenhaas
Browse files

#4 Add git lfs and by the same time restructure the dockerfile to always be...

#4 Add git lfs and by the same time restructure the dockerfile to always be based on the latest alpine release
parent 9f748873
No related branches found
No related tags found
No related merge requests found
Pipeline #5999 passed
ARG ALPINE_VERSION
FROM alpine:${ALPINE_VERSION}
FROM alpine:3.8
LABEL com.example.vendor="LakeDrops" \
maintainer="juergen.haas@lakedrops.com" \
version="1.5.0" \
description="An image for GitLab runner to build and test Drupal projects."
ARG ALPINE_VERSION
ARG PHP_VERSION
ARG compose_version=1.21.2
ARG glibc_version=2.28-r0
......@@ -42,17 +41,7 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
echo "StrictHostKeyChecking no" >> /root/.ssh/config && \
\
apk update && \
apk add --no-cache openssh wget make patch bash fish python 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-iconv \
php7-bcmath && \
if [ "${PHP_VERSION}" = "7.0" ]; then \
echo "no extra packages required" ; \
else \
apk add --no-cache php7-tokenizer php7-simplexml php7-xmlwriter ; \
fi && \
\
sed -i -e 's/memory_limit = 128M/memory_limit = -1/g' /etc/php7/php.ini && \
apk add --no-cache openssh wget make patch bash fish python git git-lfs unzip && \
\
wget -q https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${glibc_version}/glibc-${glibc_version}.apk && \
......@@ -63,8 +52,6 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
ln -s /usr/lib/libgcc_s.so.1 /lib/libgcc_s.so.1 && \
ln -s /lib/libgcc_s.so.1 /usr/glibc-compat/lib/ && \
\
ln -s /usr/bin/php7 /usr/local/bin/php && \
\
wget -q https://github.com/ahoy-cli/ahoy/releases/download/2.0.0/ahoy-bin-`uname -s`-amd64 -O /usr/local/bin/ahoy && \
chmod +x /usr/local/bin/ahoy && \
\
......@@ -73,7 +60,6 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
\
wget -q https://getcomposer.org/composer.phar -O /usr/local/bin/composer && \
chmod +x /usr/local/bin/composer && \
composer selfupdate && \
\
git clone https://github.com/tj/git-extras.git && \
cd git-extras && \
......@@ -82,6 +68,27 @@ RUN echo 'hosts: files dns' > /etc/nsswitch.conf && \
cd .. && \
rm -rf git-extras && \
\
cp /etc/apk/repositories /etc/apk/repositories.org && \
echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/main" > /etc/apk/repositories && \
echo "http://dl-cdn.alpinelinux.org/alpine/v${ALPINE_VERSION}/community" >> /etc/apk/repositories && \
apk update && \
apk add --no-cache \
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-iconv \
php7-bcmath && \
if [ "${PHP_VERSION}" = "7.0" ]; then \
echo "no extra packages required" ; \
else \
apk add --no-cache php7-tokenizer php7-simplexml php7-xmlwriter ; \
fi && \
rm /etc/apk/repositories && \
mv /etc/apk/repositories.org /etc/apk/repositories && \
apk update && \
\
sed -i -e 's/memory_limit = 128M/memory_limit = -1/g' /etc/php7/php.ini && \
ln -s /usr/bin/php7 /usr/local/bin/php && \
\
composer selfupdate && \
composer global require "hirak/prestissimo:^0.3" && \
\
ln -s /usr/local/bin/ahoy /usr/local/bin/a && \
......
FROM alpine:3.5
LABEL com.example.vendor="LakeDrops" \
maintainer="juergen.haas@lakedrops.com" \
version="1.4.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; \
\
apk add --no-cache \
ca-certificates \
curl \
openssl; \
\
if ! curl -fSL "https://download.docker.com/linux/static/${DOCKER_CHANNEL}/${dockerArch}/docker-${DOCKER_VERSION}.tgz" -o docker.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/
COPY drush.sh /usr/local/bin/drush
COPY node /usr/local/bin/node
COPY npm /usr/local/bin/npm
COPY volume.php /usr/local/bin/volume.php
COPY gulp /usr/local/bin/gulp
COPY backstop /usr/local/bin/backstop
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 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-iconv php7-bcmath && \
\
sed -i -e 's/memory_limit = 128M/memory_limit = -1/g' /etc/php7/php.ini && \
\
wget -q https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub -O /etc/apk/keys/sgerrand.rsa.pub && \
wget -q https://github.com/sgerrand/alpine-pkg-glibc/releases/download/${glibc_version}/glibc-${glibc_version}.apk && \
apk add --no-cache glibc-${glibc_version}.apk && \
rm glibc-${glibc_version}.apk && \
ln -s /lib/libz.so.1 /usr/glibc-compat/lib/ && \
ln -s /lib/libc.musl-x86_64.so.1 /usr/glibc-compat/lib && \
ln -s /usr/lib/libgcc_s.so.1 /lib/libgcc_s.so.1 && \
ln -s /lib/libgcc_s.so.1 /usr/glibc-compat/lib/ && \
\
ln -s /usr/bin/php7 /usr/local/bin/php && \
\
wget -q https://github.com/ahoy-cli/ahoy/releases/download/2.0.0/ahoy-bin-`uname -s`-amd64 -O /usr/local/bin/ahoy && \
chmod +x /usr/local/bin/ahoy && \
\
wget -q https://github.com/docker/compose/releases/download/${compose_version}/docker-compose-`uname -s`-`uname -m` -O /usr/local/bin/docker-compose && \
chmod +x /usr/local/bin/docker-compose && \
\
wget -q https://getcomposer.org/composer.phar -O /usr/local/bin/composer && \
chmod +x /usr/local/bin/composer && \
composer selfupdate 1.5.0 && \
\
git clone https://github.com/tj/git-extras.git && \
cd git-extras && \
git checkout $(git describe --tags $(git rev-list --tags --max-count=1)) && \
make install && \
cd .. && \
rm -rf git-extras && \
\
composer global require "hirak/prestissimo:^0.3" && \
\
ln -s /usr/local/bin/ahoy /usr/local/bin/a && \
ln -s /usr/local/bin/composer /usr/local/bin/c && \
ln -s /usr/local/bin/docker-compose /usr/local/bin/d-c && \
ln -s /usr/local/bin/drush /usr/local/bin/d
ENV LAKEDROPS_DEV_DC_OPTIONS "-T"
#!/bin/bash
export $(cat .env | xargs)
cd tests/backstop
docker run --rm -t -v $(php /usr/local/bin/volume.php) -w $PWD --network=traefik_${COMPOSE_PROJECT_NAME} backstopjs/backstopjs "$@"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment