Skip to content

Preparing v4 release #227

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

Merged
merged 30 commits into from
Dec 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
a4fe3cd
Remove prestissimo to be compatible with Composer 2.0
mhemrg Oct 29, 2020
5456804
Merge branch 'mhemrg/v3' into v4
moufmouf Nov 26, 2020
d23bac5
Merge branch 'v3' of github.com:thecodingmachine/docker-images-php in…
moufmouf Nov 27, 2020
a04ae19
Adding PHP 8, migrating to Composer 2, deprecating Node8 and adding N…
moufmouf Nov 27, 2020
91da97e
Also tagging PHP patch releases (in case of a regression in PHP)
moufmouf Nov 28, 2020
3a10808
Adding PHP proxy instead of Composer proxy
moufmouf Dec 2, 2020
dc0342c
Add v4-dev Github actions
Dec 4, 2020
456b781
Merge branch 'v4-dev-phpproxy' of https://github.com/thecodingmachine…
Dec 4, 2020
1166090
Remove container_started on base images so that new env var from user…
Dec 4, 2020
8bfe676
Remove deletion of /opt/container_started
Dec 4, 2020
6b60916
cleaning up /opt/container_started
moufmouf Dec 4, 2020
3cf2863
Migrating to Ubuntu 20.04
moufmouf Dec 4, 2020
beeab9a
Fixing Swoole
moufmouf Dec 4, 2020
5432a01
Add PHP script for checking PHP_* env var changes
Dec 7, 2020
7c552cf
Fix typo in PHP script
Dec 7, 2020
290a02a
Change APCu 'provider': from pecl to ondrej
Dec 7, 2020
478ff02
Refactor env var PHP script, remove sybase for PHP 8
Dec 7, 2020
4fa5bcf
Add var_dump for (ugly) testing
Dec 7, 2020
e4f1ca3
Still debugging
Dec 7, 2020
29a85d8
Still debugging
Dec 7, 2020
1cbbb8e
Still debugging
Dec 7, 2020
e13a07c
Still debugging
Dec 7, 2020
046b32e
Readd other PHP versions
Dec 7, 2020
f3d7b6a
Removing "ev" from extensions cause they don't build correctly
moufmouf Dec 7, 2020
9869a28
Fixing event build
moufmouf Dec 7, 2020
923f40a
Fixing PHP extensions with php proxy. Removing sybase extension
moufmouf Dec 7, 2020
5c8ef1c
Removing ev from PHP 8
moufmouf Dec 7, 2020
6d26456
Merge branch 'v4' of github.com:thecodingmachine/docker-images-php in…
moufmouf Dec 7, 2020
1f30fea
Fixing double call to setup_extensions
moufmouf Dec 7, 2020
bc65bd2
Dropping support for PHP 7.1
moufmouf Dec 7, 2020
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
37 changes: 22 additions & 15 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,24 @@ name: Docker PHP Images GitHub workflow
on:
pull_request:
branches:
- 'v3'
- 'v4'
push:
branches:
- 'v3'
- 'v4'
schedule:
- cron: '0 0 * * 0'
- cron: '42 3 * * 0'

jobs:
build_test_maybe_release:
strategy:
matrix:
include:
- variant: 'cli'
php_version: '8.0'
- variant: 'apache'
php_version: '8.0'
- variant: 'fpm'
php_version: '8.0'
- variant: 'cli'
php_version: '7.4'
- variant: 'apache'
Expand All @@ -33,12 +39,6 @@ jobs:
php_version: '7.2'
- variant: 'fpm'
php_version: '7.2'
- variant: 'cli'
php_version: '7.1'
- variant: 'apache'
php_version: '7.1'
- variant: 'fpm'
php_version: '7.1'
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
Expand All @@ -48,7 +48,7 @@ jobs:
- uses: actions/checkout@v1
- name: Build and test
run: |
PHP_VERSION="${{ matrix.php_version }}" BRANCH="v3" VARIANT="${{ matrix.variant }}" ./build-and-test.sh
PHP_VERSION="${{ matrix.php_version }}" BRANCH="v4" VARIANT="${{ matrix.variant }}" ./build-and-test.sh
docker images | grep thecodingmachine/php
- name: Login to DockerHub
# Merge ~ push.
Expand All @@ -62,8 +62,15 @@ jobs:
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
run: |
BRANCH_VARIANT=`echo "${{ matrix.variant }}" | sed 's/\./-/g'`
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-slim-${BRANCH_VARIANT}
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node8
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node10
docker push thecodingmachine/php:${{ matrix.php_version }}-v3-${BRANCH_VARIANT}-node12
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-slim-${BRANCH_VARIANT}
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node8
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node10
docker push thecodingmachine/php:${{ matrix.php_version }}-v4-${BRANCH_VARIANT}-node12
# Let's also tag PHP patch releases
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`
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-slim-${BRANCH_VARIANT} thecodingmachine/php:${PHP_VERSION}-v4-slim-${BRANCH_VARIANT}
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT} thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node10 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node10
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node12 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node12
docker push -t thecodingmachine/php:${PHP_PATCH_VERSION}-v4-${BRANCH_VARIANT}-node14 thecodingmachine/php:${PHP_VERSION}-v4-${BRANCH_VARIANT}-node14
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
.idea
tmp
tmp
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# v4

## New features

- Support for PHP 8.0
- Support for Node 14

## Breaking changes

- Base image is Ubuntu 20.04
- Dropped Node 8 images
- Dropped PHP 7.1

# v3

See MIGRATING.md

# v2

## New features
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.apache.node8 → Dockerfile.apache.node14
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.cli.node8 → Dockerfile.cli.node14
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.fpm.node8 → Dockerfile.fpm.node14
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends gnupg && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
curl -sL https://deb.nodesource.com/setup_14.x | bash - && \
apt-get update && \
apt-get install -y --no-install-recommends nodejs && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
Expand Down
26 changes: 10 additions & 16 deletions Dockerfile.slim.apache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:20.04

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

Expand All @@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
# Install php an other packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -36,12 +36,12 @@ RUN apt-get update \
curl \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-json \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-readline \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& 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 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

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

#ENV COMPOSER_ALLOW_SUPERUSER 1

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

# TODO: utils.php in /usr/local/bin... bof!
COPY utils/utils.php /usr/local/bin/utils.php
COPY utils/composer_proxy.php /usr/local/bin/composer
RUN mv /usr/bin/php /usr/bin/real_php
COPY utils/php_proxy.sh /usr/bin/php
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php

Expand Down Expand Up @@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
PHP_EXTENSION_XSL=1 \
PHP_EXTENSION_ZIP=1

# |--------------------------------------------------------------------------
# | prestissimo
# |--------------------------------------------------------------------------
# |
# | Installs Prestissimo to improve Composer download performance.
# |

USER docker
RUN composer global require hirak/prestissimo && \
composer global require bamarni/symfony-console-autocomplete && \
RUN composer global require bamarni/symfony-console-autocomplete && \
rm -rf ~/.composer/cache

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




USER docker

COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php
Expand Down
26 changes: 10 additions & 16 deletions Dockerfile.slim.cli
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:20.04

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

Expand All @@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
# Install php an other packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -36,12 +36,12 @@ RUN apt-get update \
curl \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-json \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-readline \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& 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 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

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

#ENV COMPOSER_ALLOW_SUPERUSER 1

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

# TODO: utils.php in /usr/local/bin... bof!
COPY utils/utils.php /usr/local/bin/utils.php
COPY utils/composer_proxy.php /usr/local/bin/composer
RUN mv /usr/bin/php /usr/bin/real_php
COPY utils/php_proxy.sh /usr/bin/php
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php

Expand Down Expand Up @@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
PHP_EXTENSION_XSL=1 \
PHP_EXTENSION_ZIP=1

# |--------------------------------------------------------------------------
# | prestissimo
# |--------------------------------------------------------------------------
# |
# | Installs Prestissimo to improve Composer download performance.
# |

USER docker
RUN composer global require hirak/prestissimo && \
composer global require bamarni/symfony-console-autocomplete && \
RUN composer global require bamarni/symfony-console-autocomplete && \
rm -rf ~/.composer/cache

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




USER docker

COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php
Expand Down
28 changes: 11 additions & 17 deletions Dockerfile.slim.fpm
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:bionic
FROM ubuntu:20.04

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

Expand All @@ -21,7 +21,7 @@ ENV PHP_VERSION=$PHP_VERSION
# Install php an other packages
RUN apt-get update \
&& apt-get install -y --no-install-recommends gnupg \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu bionic main" > /etc/apt/sources.list.d/ondrej-php.list \
&& echo "deb http://ppa.launchpad.net/ondrej/php/ubuntu focal main" > /etc/apt/sources.list.d/ondrej-php.list \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
&& apt-get update \
&& apt-get install -y --no-install-recommends \
Expand All @@ -36,12 +36,12 @@ RUN apt-get update \
curl \
php${PHP_VERSION}-cli \
php${PHP_VERSION}-curl \
php${PHP_VERSION}-json \
php${PHP_VERSION}-mbstring \
php${PHP_VERSION}-opcache \
php${PHP_VERSION}-readline \
php${PHP_VERSION}-xml \
php${PHP_VERSION}-zip \
&& 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 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*

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

#ENV COMPOSER_ALLOW_SUPERUSER 1

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

# TODO: utils.php in /usr/local/bin... bof!
COPY utils/utils.php /usr/local/bin/utils.php
COPY utils/composer_proxy.php /usr/local/bin/composer
RUN mv /usr/bin/php /usr/bin/real_php
COPY utils/php_proxy.sh /usr/bin/php
COPY utils/check_php_env_var_changes.php /usr/local/bin/check_php_env_var_changes.php
COPY utils/php_env_var_cache.php /opt/php_env_var_cache.php
COPY utils/generate_conf.php /usr/local/bin/generate_conf.php
COPY utils/setup_extensions.php /usr/local/bin/setup_extensions.php

Expand Down Expand Up @@ -129,16 +132,8 @@ ENV PHP_EXTENSION_CALENDAR=1 \
PHP_EXTENSION_XSL=1 \
PHP_EXTENSION_ZIP=1

# |--------------------------------------------------------------------------
# | prestissimo
# |--------------------------------------------------------------------------
# |
# | Installs Prestissimo to improve Composer download performance.
# |

USER docker
RUN composer global require hirak/prestissimo && \
composer global require bamarni/symfony-console-autocomplete && \
RUN composer global require bamarni/symfony-console-autocomplete && \
rm -rf ~/.composer/cache

USER root
Expand Down Expand Up @@ -257,13 +252,12 @@ RUN ln -s /etc/php/${PHP_VERSION}/mods-available/generated_conf.ini /etc/php/${P
sed -i 's/^group = www-data/;group = www-data/g' /etc/php/${PHP_VERSION}/fpm/pool.d/www.conf && \
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 && \
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 && \
if [ "$PHP_VERSION" = "7.1" ] || [ "$PHP_VERSION" = "7.2" ]; then \
if [ "$PHP_VERSION" = "7.2" ]; then \
sed -i 's/^log_limit =/;log_limit =/g' /etc/php/${PHP_VERSION}/fpm/pool.d/docker.conf && \
sed -i 's/^decorate_workers_output =/;decorate_workers_output =/g' /etc/php/${PHP_VERSION}/fpm/pool.d/docker.conf; \
fi



USER docker

COPY utils/install_selected_extensions.php /usr/local/bin/install_selected_extensions.php
Expand Down
11 changes: 10 additions & 1 deletion MIGRATING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
# Migrating from v3 to v4 images

Important changes:

- v3 images are based on **Ubuntu 18.04**. v4 images are based on **Ubuntu 20.04**.
- Internally, the image will attempt to set up extensions / parameters on container startup (in the image entry point),
but also when PHP is run. This should help alleviate a part of the problems when the entrypoint is overloaded by the
user.

# Migrating from v2 to v3 images

Important changes:

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

Expand Down
Loading