Skip to content

Commit 078b818

Browse files
authored
Merge pull request #227 from thecodingmachine/v4-dev
Preparing v4 release
2 parents 0985339 + bc65bd2 commit 078b818

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+349
-306
lines changed

.github/workflows/workflow.yml

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,24 @@ name: Docker PHP Images GitHub workflow
33
on:
44
pull_request:
55
branches:
6-
- 'v3'
6+
- 'v4'
77
push:
88
branches:
9-
- 'v3'
9+
- 'v4'
1010
schedule:
11-
- cron: '0 0 * * 0'
11+
- cron: '42 3 * * 0'
1212

1313
jobs:
1414
build_test_maybe_release:
1515
strategy:
1616
matrix:
1717
include:
18+
- variant: 'cli'
19+
php_version: '8.0'
20+
- variant: 'apache'
21+
php_version: '8.0'
22+
- variant: 'fpm'
23+
php_version: '8.0'
1824
- variant: 'cli'
1925
php_version: '7.4'
2026
- variant: 'apache'
@@ -33,12 +39,6 @@ jobs:
3339
php_version: '7.2'
3440
- variant: 'fpm'
3541
php_version: '7.2'
36-
- variant: 'cli'
37-
php_version: '7.1'
38-
- variant: 'apache'
39-
php_version: '7.1'
40-
- variant: 'fpm'
41-
php_version: '7.1'
4242
runs-on: ubuntu-latest
4343
steps:
4444
- name: Set up QEMU
@@ -48,7 +48,7 @@ jobs:
4848
- uses: actions/checkout@v1
4949
- name: Build and test
5050
run: |
51-
PHP_VERSION="${{ matrix.php_version }}" BRANCH="v3" VARIANT="${{ matrix.variant }}" ./build-and-test.sh
51+
PHP_VERSION="${{ matrix.php_version }}" BRANCH="v4" VARIANT="${{ matrix.variant }}" ./build-and-test.sh
5252
docker images | grep thecodingmachine/php
5353
- name: Login to DockerHub
5454
# Merge ~ push.
@@ -62,8 +62,15 @@ jobs:
6262
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
6363
run: |
6464
BRANCH_VARIANT=`echo "${{ matrix.variant }}" | sed 's/\./-/g'`
65-
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-slim-${BRANCH_VARIANT}
66-
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}
67-
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node8
68-
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node10
69-
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node12
65+
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-slim-${BRANCH_VARIANT}
66+
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}
67+
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node8
68+
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node10
69+
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node12
70+
# Let's also tag PHP patch releases
71+
PHP_PATCH_VERSION=`docker run --rm thecodingmachine/php:${{ matrix.php_version }}-v4-slim-${BRANCH_VARIANT} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o`
72+
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-slim-${BRANCH_VARIANT} thecodingmachine/php:${PHP_VERSION}-v4-slim-${BRANCH_VARIANT}
73+
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT} thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}
74+
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node10 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node10
75+
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node12 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node12
76+
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node14 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node14

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
.idea
2-
tmp
2+
tmp

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
# v4
2+
3+
## New features
4+
5+
- Support for PHP 8.0
6+
- Support for Node 14
7+
8+
## Breaking changes
9+
10+
- Base image is Ubuntu 20.04
11+
- Dropped Node 8 images
12+
- Dropped PHP 7.1
13+
14+
# v3
15+
16+
See MIGRATING.md
17+
118
# v2
219

320
## New features

Dockerfile.apache.node8 renamed to Dockerfile.apache.node14

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ USER root
88

99
RUN apt-get update && \
1010
apt-get install -y --no-install-recommends gnupg && \
11-
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
11+
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
1212
apt-get update && \
1313
apt-get install -y --no-install-recommends nodejs && \
1414
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \

Dockerfile.cli.node8 renamed to Dockerfile.cli.node14

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ USER root
88

99
RUN apt-get update && \
1010
apt-get install -y --no-install-recommends gnupg && \
11-
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
11+
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
1212
apt-get update && \
1313
apt-get install -y --no-install-recommends nodejs && \
1414
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \

Dockerfile.fpm.node8 renamed to Dockerfile.fpm.node14

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ USER root
88

99
RUN apt-get update && \
1010
apt-get install -y --no-install-recommends gnupg && \
11-
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
11+
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
1212
apt-get update && \
1313
apt-get install -y --no-install-recommends nodejs && \
1414
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \

Dockerfile.slim.apache

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:20.04
22

33
LABEL authors="Julien Neuhart <[email protected]>, David Négrier <[email protected]>"
44

@@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
2121
# Install php an other packages
2222
RUN apt-get update \
2323
&& apt-get install -y --no-install-recommends gnupg \
24-
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
24+
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
2525
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
2626
&& apt-get update \
2727
&& apt-get install -y --no-install-recommends \
@@ -36,12 +36,12 @@ RUN apt-get update \
3636
curl \
3737
php${PHP_VERSION}-cli \
3838
php${PHP_VERSION}-curl \
39-
php${PHP_VERSION}-json \
4039
php${PHP_VERSION}-mbstring \
4140
php${PHP_VERSION}-opcache \
4241
php${PHP_VERSION}-readline \
4342
php${PHP_VERSION}-xml \
4443
php${PHP_VERSION}-zip \
44+
&& if [ "${PHP_VERSION}" = "7.1" ] || [ "${PHP_VERSION}" = "7.2" ] || [ "${PHP_VERSION}" = "7.3" ] || [ "${PHP_VERSION}" = "7.4" ]; then apt-get install -y --no-install-recommends php${PHP_VERSION}-json; fi \
4545
&& apt-get clean \
4646
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
4747

@@ -86,12 +86,15 @@ RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
8686

8787
#ENV COMPOSER_ALLOW_SUPERUSER 1
8888

89-
RUN curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=real_composer &&\
90-
chmod +x /usr/local/bin/real_composer
89+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer &&\
90+
chmod +x /usr/local/bin/composer
9191

9292
# TODO: utils.php in /usr/local/bin... bof!
9393
COPY utils/utils.php /usr/local/bin/utils.php
94-
COPY utils/composer_proxy.php /usr/local/bin/composer
94+
RUN mv /usr/bin/php /usr/bin/real_php
95+
COPY utils/php_proxy.sh /usr/bin/php
96+
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
97+
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
9598
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
9699
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php
97100

@@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
129132
PHP_EXTENSION_XSL=1 \
130133
PHP_EXTENSION_ZIP=1
131134

132-
# |--------------------------------------------------------------------------
133-
# | prestissimo
134-
# |--------------------------------------------------------------------------
135-
# |
136-
# | Installs Prestissimo to improve Composer download performance.
137-
# |
138-
139135
USER docker
140-
RUN composer global require hirak/prestissimo && \
141-
composer global require bamarni/symfony-console-autocomplete && \
136+
RUN composer global require bamarni/symfony-console-autocomplete && \
142137
rm -rf ~/.composer/cache
143138

144139
USER root
@@ -335,7 +330,6 @@ RUN ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${P
335330

336331

337332

338-
339333
USER docker
340334

341335
COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php

Dockerfile.slim.cli

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:20.04
22

33
LABEL authors="Julien Neuhart <[email protected]>, David Négrier <[email protected]>"
44

@@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
2121
# Install php an other packages
2222
RUN apt-get update \
2323
&& apt-get install -y --no-install-recommends gnupg \
24-
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
24+
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
2525
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
2626
&& apt-get update \
2727
&& apt-get install -y --no-install-recommends \
@@ -36,12 +36,12 @@ RUN apt-get update \
3636
curl \
3737
php${PHP_VERSION}-cli \
3838
php${PHP_VERSION}-curl \
39-
php${PHP_VERSION}-json \
4039
php${PHP_VERSION}-mbstring \
4140
php${PHP_VERSION}-opcache \
4241
php${PHP_VERSION}-readline \
4342
php${PHP_VERSION}-xml \
4443
php${PHP_VERSION}-zip \
44+
&& if [ "${PHP_VERSION}" = "7.1" ] || [ "${PHP_VERSION}" = "7.2" ] || [ "${PHP_VERSION}" = "7.3" ] || [ "${PHP_VERSION}" = "7.4" ]; then apt-get install -y --no-install-recommends php${PHP_VERSION}-json; fi \
4545
&& apt-get clean \
4646
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
4747

@@ -86,12 +86,15 @@ RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
8686

8787
#ENV COMPOSER_ALLOW_SUPERUSER 1
8888

89-
RUN curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=real_composer &&\
90-
chmod +x /usr/local/bin/real_composer
89+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer &&\
90+
chmod +x /usr/local/bin/composer
9191

9292
# TODO: utils.php in /usr/local/bin... bof!
9393
COPY utils/utils.php /usr/local/bin/utils.php
94-
COPY utils/composer_proxy.php /usr/local/bin/composer
94+
RUN mv /usr/bin/php /usr/bin/real_php
95+
COPY utils/php_proxy.sh /usr/bin/php
96+
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
97+
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
9598
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
9699
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php
97100

@@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
129132
PHP_EXTENSION_XSL=1 \
130133
PHP_EXTENSION_ZIP=1
131134

132-
# |--------------------------------------------------------------------------
133-
# | prestissimo
134-
# |--------------------------------------------------------------------------
135-
# |
136-
# | Installs Prestissimo to improve Composer download performance.
137-
# |
138-
139135
USER docker
140-
RUN composer global require hirak/prestissimo && \
141-
composer global require bamarni/symfony-console-autocomplete && \
136+
RUN composer global require bamarni/symfony-console-autocomplete && \
142137
rm -rf ~/.composer/cache
143138

144139
USER root
@@ -240,7 +235,6 @@ RUN touch /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini && ln -s /et
240235

241236

242237

243-
244238
USER docker
245239

246240
COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php

Dockerfile.slim.fpm

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:bionic
1+
FROM ubuntu:20.04
22

33
LABEL authors="Julien Neuhart <[email protected]>, David Négrier <[email protected]>"
44

@@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
2121
# Install php an other packages
2222
RUN apt-get update \
2323
&& apt-get install -y --no-install-recommends gnupg \
24-
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
24+
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
2525
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
2626
&& apt-get update \
2727
&& apt-get install -y --no-install-recommends \
@@ -36,12 +36,12 @@ RUN apt-get update \
3636
curl \
3737
php${PHP_VERSION}-cli \
3838
php${PHP_VERSION}-curl \
39-
php${PHP_VERSION}-json \
4039
php${PHP_VERSION}-mbstring \
4140
php${PHP_VERSION}-opcache \
4241
php${PHP_VERSION}-readline \
4342
php${PHP_VERSION}-xml \
4443
php${PHP_VERSION}-zip \
44+
&& if [ "${PHP_VERSION}" = "7.1" ] || [ "${PHP_VERSION}" = "7.2" ] || [ "${PHP_VERSION}" = "7.3" ] || [ "${PHP_VERSION}" = "7.4" ]; then apt-get install -y --no-install-recommends php${PHP_VERSION}-json; fi \
4545
&& apt-get clean \
4646
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
4747

@@ -86,12 +86,15 @@ RUN rm /etc/php/${PHP_VERSION}/cli/php.ini
8686

8787
#ENV COMPOSER_ALLOW_SUPERUSER 1
8888

89-
RUN curl -sS https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=real_composer &&\
90-
chmod +x /usr/local/bin/real_composer
89+
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer &&\
90+
chmod +x /usr/local/bin/composer
9191

9292
# TODO: utils.php in /usr/local/bin... bof!
9393
COPY utils/utils.php /usr/local/bin/utils.php
94-
COPY utils/composer_proxy.php /usr/local/bin/composer
94+
RUN mv /usr/bin/php /usr/bin/real_php
95+
COPY utils/php_proxy.sh /usr/bin/php
96+
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
97+
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
9598
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
9699
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php
97100

@@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
129132
PHP_EXTENSION_XSL=1 \
130133
PHP_EXTENSION_ZIP=1
131134

132-
# |--------------------------------------------------------------------------
133-
# | prestissimo
134-
# |--------------------------------------------------------------------------
135-
# |
136-
# | Installs Prestissimo to improve Composer download performance.
137-
# |
138-
139135
USER docker
140-
RUN composer global require hirak/prestissimo && \
141-
composer global require bamarni/symfony-console-autocomplete && \
136+
RUN composer global require bamarni/symfony-console-autocomplete && \
142137
rm -rf ~/.composer/cache
143138

144139
USER root
@@ -257,13 +252,12 @@ RUN ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${P
257252
sed -i 's/^group = www-data/;group = www-data/g' /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf && \
258253
sed -i 's#listen = /run/php/php${PHP_VERSION}-fpm.sock#;listen = /run/php/php${PHP_VERSION}-fpm.sock#g' /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf && \
259254
sed -i "s#pid = /run/php/php${PHP_VERSION}-fpm.pid#;pid = /run/php/php${PHP_VERSION}-fpm.pid#g" /etc/php/${PHP_VERSION}/fpm/php-fpm.conf && \
260-
if [ "$PHP_VERSION" = "7.1" ] || [ "$PHP_VERSION" = "7.2" ]; then \
255+
if [ "$PHP_VERSION" = "7.2" ]; then \
261256
sed -i 's/^log_limit =/;log_limit =/g' /etc/php/${PHP_VERSION}/fpm/pool.d/docker.conf && \
262257
sed -i 's/^decorate_workers_output =/;decorate_workers_output =/g' /etc/php/${PHP_VERSION}/fpm/pool.d/docker.conf; \
263258
fi
264259

265260

266-
267261
USER docker
268262

269263
COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php

MIGRATING.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
1+
# Migrating from v3 to v4 images
2+
3+
Important changes:
4+
5+
- v3 images are based on **Ubuntu 18.04**. v4 images are based on **Ubuntu 20.04**.
6+
- Internally, the image will attempt to set up extensions / parameters on container startup (in the image entry point),
7+
but also when PHP is run. This should help alleviate a part of the problems when the entrypoint is overloaded by the
8+
user.
9+
110
# Migrating from v2 to v3 images
211

312
Important changes:
413

514
- v2 images are based on a Debian Stretch. v3 images are based on **Ubuntu 18.04**.
6-
- Interally, v3 images are built from the [Ondrej PPA](https://launchpad.net/%7Eondrej/+archive/ubuntu/php/+index?batch=75&memo=75&start=75).
15+
- Internally, v3 images are built from the [Ondrej PPA](https://launchpad.net/%7Eondrej/+archive/ubuntu/php/+index?batch=75&memo=75&start=75).
716
This is a radical change from v2 that was built from the official PHP Docker image.
817
As a result, the v3 image do not have PECL installed, nor a build environment. This makes the v3 images ~200MB lighter.
918

0 commit comments

Comments
 (0)