Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update existing images to alpine 3.15 #405

Merged
merged 4 commits into from
Feb 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ node ('lagoon-images') {
sh script: "git submodule add -b php81 https://github.com/lagoon-examples/drupal9-base drupal9-base-php81"
sh script: "git submodule sync && git submodule update --init"
sh script: "mkdir -p ./all-images && cp ../helpers/docker-compose.yml ./all-images/ && cp ../helpers/TESTING_dockercompose.md ./all-images/"
sh script: "sed -i '/image:/ s/uselagoon/${CI_BUILD_TAG}/' ./all-images/docker-compose.yml"
sh script: "yarn install"
sh script: "yarn generate-tests"
sh script: "docker network inspect amazeeio-network >/dev/null || docker network create amazeeio-network"
Expand Down
36 changes: 23 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,41 +179,48 @@ build/rabbitmq-cluster: build/rabbitmq images/rabbitmq-cluster/Dockerfile

versioned-images := php-7.4-fpm \
php-8.0-fpm \
php-8.1-fpm \
php-7.4-cli \
php-8.0-cli \
php-8.1-cli \
php-7.4-cli-drupal \
php-8.0-cli-drupal \
php-8.1-cli-drupal \
python-3.7 \
python-3.8 \
python-3.9 \
python-3.10 \
node-12 \
node-14 \
node-16 \
node-12-builder \
node-14 \
node-14-builder \
node-16 \
node-16-builder \
solr-7.7 \
solr-7.7-drupal \
solr-7 \
solr-7-drupal \
solr-8 \
solr-8-drupal \
elasticsearch-6 \
elasticsearch-7 \
kibana-6 \
kibana-7 \
logstash-6 \
logstash-7 \
postgres-12 \
postgres-13 \
postgres-14 \
redis-6 \
redis-6-persistent \
solr-7 \
solr-7-drupal \
mariadb-10.5 \
mariadb-10.5-drupal \
mariadb-10.6 \
mariadb-10.6-drupal \
varnish-6 \
varnish-6-drupal \
varnish-6-persistent \
varnish-6-persistent-drupal \
php-8.1-fpm \
php-8.1-cli \
php-8.1-cli-drupal
varnish-6-persistent-drupal

# default-versioned-images are images that formerly had no versioning, and are made backwards-compatible.
# the below versions are the ones that map to the unversioned namespace
Expand All @@ -234,8 +241,7 @@ default-versioned-images := mariadb-10.4 \
####### Experimental Images
#######

experimental-images := solr-8 \
solr-8-drupal
experimental-images :=

build-versioned-images = $(foreach image,$(versioned-images) $(default-versioned-images) $(experimental-images),build/$(image))

Expand Down Expand Up @@ -270,16 +276,19 @@ build/php-8.1-cli: build/php-8.1-fpm
build/php-7.4-cli-drupal: build/php-7.4-cli
build/php-8.0-cli-drupal: build/php-8.0-cli
build/php-8.1-cli-drupal: build/php-8.1-cli
build/python-3.7 build/python-3.8 build/python-3.9: build/commons
build/python-3.7 build/python-3.8 build/python-3.9 build/python-3.10: build/commons
build/node-12 build/node-14 build/node-16: build/commons
build/node-12-builder: build/node-12
build/node-14-builder: build/node-14
build/node-16-builder: build/node-16
build/solr-7.7: build/commons
build/solr-7.7-drupal: build/solr-7.7
build/elasticsearch-6 build/elasticsearch-7 build/kibana-6 build/kibana-7 build/logstash-6 build/logstash-7: build/commons
build/postgres-11 build/postgres-12: build/commons
build/postgres-11 build/postgres-12 build/postgres-13 build/postgres-14: build/commons
build/postgres-11-ckan build/postgres-11-drupal: build/postgres-11
build/postgres-14-drupal: build/postgres-12
build/postgres-13-drupal: build/postgres-13
build/postgres-14-drupal: build/postgres-14
build/redis-5 build/redis-6: build/commons
build/redis-5-persistent: build/redis-5
build/redis-6-persistent: build/redis-6
Expand All @@ -291,9 +300,10 @@ build/varnish-6-persistent-drupal: build/varnish-6-drupal
build/solr-7 build/solr-8: build/commons
build/solr-7-drupal: build/solr-7
build/solr-8-drupal: build/solr-8
build/mariadb-10.4 build/mariadb-10.5: build/commons
build/mariadb-10.4 build/mariadb-10.5 build/mariadb-10.6: build/commons
build/mariadb-10.4-drupal: build/mariadb-10.4
build/mariadb-10.5-drupal: build/mariadb-10.5
build/mariadb-10.6-drupal: build/mariadb-10.6

#######
####### Building Images
Expand Down
51 changes: 48 additions & 3 deletions helpers/TESTING_dockercompose.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ docker-compose build && docker-compose up -d
# Ensure database pods are ready to connect
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://mariadb-10.4:3306 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://mariadb-10.5:3306 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://mariadb-10.6:3306 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-11:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-12:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-13:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://postgres-14:5432 -timeout 1m
docker run --rm --net all-images_default jwilder/dockerize dockerize -wait tcp://mongo:27017 -timeout 1m
```

Expand All @@ -34,19 +37,25 @@ Run the following commands to validate things are rolling as they should.
# Should have all the services we expect
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_mariadb-10.4_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_mariadb-10.5_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_mariadb-10.6_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_mongo_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_node-12_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_node-14_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_node-16_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_postgres-11_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_postgres-12_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_postgres-13_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_postgres-14_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_python-3.7_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_python-3.8_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_python-3.9_1
docker ps -a --filter label=com.docker.compose.project=all-images | grep Exited | grep all-images_python-3.10_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_rabbitmq_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_redis-5_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_redis-6_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_solr-7_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_solr-7.7_1
docker ps --filter label=com.docker.compose.project=all-images | grep Up | grep all-images_solr-8_1

# commons Should be running Alpine Linux
docker-compose exec -T commons sh -c "cat /etc/os-release" | grep "Alpine Linux"
Expand Down Expand Up @@ -85,7 +94,16 @@ docker-compose exec -T commons sh -c "curl solr-7:8983/solr/admin/cores?action=S
docker-compose exec -T commons sh -c "curl solr-7:8983/solr/admin/cores?action=RELOAD\&core=mycore"

# solr-7 Check Solr has 7.7 solrconfig in "mycore" core
docker-compose exec -T solr-7 sh -c "cat /opt/solr/server/solr/mycores/mycore/conf/solrconfig.xml" | grep 7.7
docker-compose exec -T solr-7 sh -c "cat /opt/solr/server/solr/mycores/mycore/conf/solrconfig.xml" | grep luceneMatchVersion | grep 7.7

# solr-8 Should have a "mycore" Solr core
docker-compose exec -T commons sh -c "curl solr-8:8983/solr/admin/cores?action=STATUS\&core=mycore"

# solr-8 Should be able to reload "mycore" Solr core
docker-compose exec -T commons sh -c "curl solr-8:8983/solr/admin/cores?action=RELOAD\&core=mycore"

# solr-8 Check Solr has 8 solrconfig in "mycore" core
docker-compose exec -T solr-8 sh -c "cat /var/solr/data/mycore/conf/solrconfig.xml" | grep luceneMatchVersion | grep 8.

# solr-7.7 Should have a "mycore" Solr core
docker-compose exec -T commons sh -c "curl solr-7.7:8983/solr/admin/cores?action=STATUS\&core=mycore"
Expand All @@ -94,7 +112,7 @@ docker-compose exec -T commons sh -c "curl solr-7.7:8983/solr/admin/cores?action
docker-compose exec -T commons sh -c "curl solr-7.7:8983/solr/admin/cores?action=RELOAD\&core=mycore"

# solr-7.7 Check Solr has 7.7 solrconfig in "mycore" core
docker-compose exec -T solr-7.7 sh -c "cat /opt/solr/server/solr/mycores/mycore/conf/solrconfig.xml" | grep 7.7
docker-compose exec -T solr-7.7 sh -c "cat /opt/solr/server/solr/mycores/mycore/conf/solrconfig.xml" | grep luceneMatchVersion | grep 7.7

# mariadb-10.4 should be version 10.4 client
docker-compose exec -T mariadb-10.4 sh -c "mysql -V" | grep "10.4"
Expand All @@ -114,6 +132,15 @@ docker-compose exec -T mariadb-10.5 sh -c "mysql -e \'SHOW variables;\'" | grep
# mariadb-10.5 check default credentials
docker-compose exec -T mariadb-10.5 sh -c "mysql -D lagoon -u lagoon --password=lagoon -e \'SHOW databases;\'" | grep lagoon

# mariadb-10.6 should be version 10.6 client
docker-compose exec -T mariadb-10.6 sh -c "mysql -V" | grep "10.6"

# mariadb-10.6 should be version 10.6 server
docker-compose exec -T mariadb-10.6 sh -c "mysql -e \'SHOW variables;\'" | grep "version" | grep "10.6"

# mariadb-10.6 check default credentials
docker-compose exec -T mariadb-10.6 sh -c "mysql -D lagoon -u lagoon --password=lagoon -e \'SHOW databases;\'" | grep lagoon

# mongo should be version 3.6 client
docker-compose exec -T mongo sh -c "mongo --version" | grep "shell version" | grep "v3.6"

Expand All @@ -132,14 +159,32 @@ docker-compose exec -T postgres-11 bash -c "psql -U lagoon -d lagoon -c \'SELECT
# postgres-11 should have lagoon database
docker-compose exec -T postgres-11 bash -c "psql -U lagoon -d lagoon -c \'\\l+ lagoon\'" | grep "lagoon"

# postgres-12 should be version 11 client
# postgres-12 should be version 12 client
docker-compose exec -T postgres-12 bash -c "psql --version" | grep "psql" | grep "12."

# postgres-12 should be version 12 server
docker-compose exec -T postgres-12 bash -c "psql -U lagoon -d lagoon -c \'SELECT version();\'" | grep "PostgreSQL" | grep "12."

# postgres-12 should have lagoon database
docker-compose exec -T postgres-12 bash -c "psql -U lagoon -d lagoon -c \'\\l+ lagoon\'" | grep "lagoon"

# postgres-13 should be version 13 client
docker-compose exec -T postgres-13 bash -c "psql --version" | grep "psql" | grep "13."

# postgres-13 should be version 13 server
docker-compose exec -T postgres-13 bash -c "psql -U lagoon -d lagoon -c \'SELECT version();\'" | grep "PostgreSQL" | grep "13."

# postgres-13 should have lagoon database
docker-compose exec -T postgres-13 bash -c "psql -U lagoon -d lagoon -c \'\\l+ lagoon\'" | grep "lagoon"

# postgres-14 should be version 14 client
docker-compose exec -T postgres-14 bash -c "psql --version" | grep "psql" | grep "14."

# postgres-14 should be version 14 server
docker-compose exec -T postgres-14 bash -c "psql -U lagoon -d lagoon -c \'SELECT version();\'" | grep "PostgreSQL" | grep "14."

# postgres-14 should have lagoon database
docker-compose exec -T postgres-14 bash -c "psql -U lagoon -d lagoon -c \'\\l+ lagoon\'" | grep "lagoon"
```

Destroy tests
Expand Down
35 changes: 35 additions & 0 deletions helpers/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ services:
- "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
<< : *default-user # uses the defined user from top

mariadb-10.6:
image: uselagoon/mariadb-10.6:latest
labels:
lando.type: mariadb
ports:
- "3306" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
<< : *default-user # uses the defined user from top

mongo:
image: uselagoon/mongo:latest
ports:
Expand Down Expand Up @@ -73,6 +81,24 @@ services:
- "5432" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
<< : *default-user # uses the defined user from top


postgres-13:
image: uselagoon/postgres-13:latest
labels:
lando.type: postgres
ports:
- "5432" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
<< : *default-user # uses the defined user from top


postgres-14:
image: uselagoon/postgres-14:latest
labels:
lando.type: postgres
ports:
- "5432" # exposes the port 3306 with a random local port, find it with `docker-compose port mariadb 3306`
<< : *default-user # uses the defined user from top

python-3.7:
image: uselagoon/python-3.7:latest
<< : *default-user # uses the defined user from top
Expand All @@ -85,6 +111,9 @@ services:
image: uselagoon/python-3.9:latest
<< : *default-user # uses the defined user from top

python-3.10:
image: uselagoon/python-3.10:latest
<< : *default-user # uses the defined user from top
rabbitmq:
image: uselagoon/rabbitmq:latest
<< : *default-user # uses the defined user from top
Expand Down Expand Up @@ -122,6 +151,12 @@ services:
ports:
- "8983" # exposes the port 8983 with a random local port, find it with `docker-compose port solr 8983`

solr-8:
image: uselagoon/solr-8:latest
labels:
lando.type: solr
ports:
- "8983" # exposes the port 8983 with a random local port, find it with `docker-compose port solr 8983`
networks:
amazeeio-network:
external: true
2 changes: 1 addition & 1 deletion images/commons/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM webdevops/go-crond:21.5.0-alpine AS go-crond
FROM amazeeio/envplate:v1.0.0-rc.3 AS envplate

FROM alpine:3.14.3
FROM alpine:3.15.0

LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images"
Expand Down
9 changes: 9 additions & 0 deletions images/mariadb-drupal/10.6.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/mariadb-10.6

LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images"

ENV MARIADB_DATABASE=drupal \
MARIADB_USER=drupal \
MARIADB_PASSWORD=drupal
78 changes: 78 additions & 0 deletions images/mariadb/10.6.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/commons as commons
FROM alpine:3.15.0

LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images"

ARG LAGOON_VERSION
ENV LAGOON_VERSION=$LAGOON_VERSION

# Copy commons files
COPY --from=commons /lagoon /lagoon
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/wait-for /bin/
COPY --from=commons /sbin/tini /sbin/
COPY --from=commons /home /home

RUN fix-permissions /etc/passwd \
&& mkdir -p /home

ENV TMPDIR=/tmp \
TMP=/tmp \
HOME=/home \
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV`
ENV=/home/.bashrc \
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV`
BASH_ENV=/home/.bashrc

ENV BACKUPS_DIR="/var/lib/mysql/backup"

ENV MARIADB_DATABASE=lagoon \
MARIADB_USER=lagoon \
MARIADB_PASSWORD=lagoon \
MARIADB_ROOT_PASSWORD=Lag00n

RUN \
apk add --no-cache --virtual .common-run-deps \
bash \
curl \
mariadb=~10.6 \
mariadb-client=~10.6 \
mariadb-common=~10.6 \
mariadb-server-utils=~10.6 \
net-tools \
pwgen \
tzdata \
wget \
gettext; \
rm -rf /tmp/* /var/tmp/* /var/cache/apk/* /var/cache/distfiles/*; \
rm -rf /var/lib/mysql/* /etc/mysql/ /etc/my.cnf*; \
curl -sSL https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl -o mysqltuner.pl

COPY entrypoints/ /lagoon/entrypoints/
COPY mysql-backup.sh /lagoon/
COPY my.cnf /etc/mysql/my.cnf

RUN for i in /var/run/mysqld /var/lib/mysql /etc/mysql/conf.d /docker-entrypoint-initdb.d/ "${BACKUPS_DIR}" /home; \
do mkdir -p $i; chown mysql $i; /bin/fix-permissions $i; \
done

COPY root/usr/share/container-scripts/mysql/readiness-probe.sh /usr/share/container-scripts/mysql/readiness-probe.sh
RUN /bin/fix-permissions /usr/share/container-scripts/mysql/ \
&& /bin/fix-permissions /etc/mysql

RUN touch /var/log/mariadb-slow.log && /bin/fix-permissions /var/log/mariadb-slow.log \
&& touch /var/log/mariadb-queries.log && /bin/fix-permissions /var/log/mariadb-queries.log

# We cannot start mysql as root, we add the user mysql to the group root and
# change the user of the Docker Image to this user.
RUN addgroup mysql root
USER mysql
ENV USER_NAME mysql

WORKDIR /var/lib/mysql
VOLUME /var/lib/mysql
EXPOSE 3306

ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.bash"]
CMD ["mysqld"]
2 changes: 1 addition & 1 deletion images/node/12.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG IMAGE_REPO
FROM ${IMAGE_REPO:-lagoon}/commons as commons
FROM node:12.22-alpine3.14
FROM node:12.22-alpine3.15

LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors"
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images"
Expand Down
Loading