Skip to content

Commit e79f164

Browse files
committed
[INFRA] bump new PHP versions
1 parent 6f86a50 commit e79f164

File tree

9 files changed

+2188
-6
lines changed

9 files changed

+2188
-6
lines changed

.github/workflows/php-8.1.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
version: ['8.1']
19-
patchVersion: [24,25,26,27,28]
19+
patchVersion: [26,27,28,29,30]
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v4

.github/workflows/php-8.2.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
version: ['8.2']
19-
patchVersion: [17,18,19,20,21]
19+
patchVersion: [22,23,24,25,26]
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v4

.github/workflows/php-8.3.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
strategy:
1717
matrix:
1818
version: ['8.3']
19-
patchVersion: [5,6,7,8,9]
19+
patchVersion: [10,11,12,13,14]
2020
steps:
2121
- name: Checkout
2222
uses: actions/checkout@v4

.github/workflows/php-8.4.yml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: "8.3"
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'src/8.2/**'
9+
- '.github/workflows/php-8.2.yml'
10+
schedule:
11+
- cron: '00 7 * * 1'
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
version: ['8.4']
19+
patchVersion: [0,1]
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v4
23+
- name: Set up QEMU
24+
uses: docker/setup-qemu-action@v3
25+
- name: Set up Docker Buildx
26+
id: buildx
27+
uses: docker/setup-buildx-action@v3
28+
- name: Login to DockerHub
29+
uses: docker/login-action@v3
30+
with:
31+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
32+
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
33+
- name: Build php image
34+
id: docker_build
35+
uses: docker/build-push-action@v6
36+
with:
37+
push: true
38+
platforms: linux/amd64,linux/arm64
39+
tags: openmage/php:${{ matrix.version }}.${{ matrix.patchVersion }}
40+
context: ./src/${{ matrix.version }}/src
41+
file: ./src/${{ matrix.version }}/src/Dockerfile
42+
target: php
43+
build-args: |
44+
PHP_VERSION=${{ matrix.version }}.${{ matrix.patchVersion }}
45+
- name: Build toolbox image
46+
uses: docker/build-push-action@v6
47+
with:
48+
push: true
49+
platforms: linux/amd64,linux/arm64
50+
tags: openmage/php:${{ matrix.version }}.${{ matrix.patchVersion }}-toolbox
51+
context: ./src/${{ matrix.version }}/src
52+
file: ./src/${{ matrix.version }}/src/Dockerfile
53+
target: toolbox
54+
build-args: |
55+
PHP_VERSION=${{ matrix.version }}.${{ matrix.patchVersion }}

src/8.1/src/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG PHP_PECL_REQUIREMENTS="redis igbinary"
1010
ARG PHP_CONFIGURE_ARGS="--enable-soap --enable-intl"
1111
ARG PHP_CONFIGURE_ARGS_EXTRA=""
1212
ARG PHP_CONFIGURE_ARGS_FPM="--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data"
13-
ARG PHP_VERSION="8.1.28"
13+
ARG PHP_VERSION="8.1.30"
1414

1515
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
1616
PHP_CPPFLAGS="-fstack-protector-strong -fpic -fpie -O2" \

src/8.2/src/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG PHP_PECL_REQUIREMENTS="redis igbinary"
1010
ARG PHP_CONFIGURE_ARGS="--enable-soap --enable-intl"
1111
ARG PHP_CONFIGURE_ARGS_EXTRA=""
1212
ARG PHP_CONFIGURE_ARGS_FPM="--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data"
13-
ARG PHP_VERSION="8.2.21"
13+
ARG PHP_VERSION="8.2.26"
1414

1515
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
1616
PHP_CPPFLAGS="-fstack-protector-strong -fpic -fpie -O2" \

src/8.3/src/Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ ARG PHP_PECL_REQUIREMENTS="redis igbinary"
1010
ARG PHP_CONFIGURE_ARGS="--enable-soap --enable-intl"
1111
ARG PHP_CONFIGURE_ARGS_EXTRA=""
1212
ARG PHP_CONFIGURE_ARGS_FPM="--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data"
13-
ARG PHP_VERSION="8.3.9"
13+
ARG PHP_VERSION="8.3.14"
1414

1515
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
1616
PHP_CPPFLAGS="-fstack-protector-strong -fpic -fpie -O2" \

src/8.4/src/Dockerfile

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
FROM openmage/php-base:bookworm-latest AS php
2+
3+
COPY FS /
4+
5+
ARG PHP_RUNTIME_REQUIREMENTS="jq curl libcurl3-gnutls ca-certificates libedit2 libgmp-dev libfreetype6 libltdl7 libmcrypt4 sqlite3 libpng16-16 libzip4 libfcgi-bin libtidy5deb1 libsodium23 libonig5 cron vim.tiny php-xdebug zip"
6+
ARG PHP_RUNTIME_REQUIREMENTS_EXTRA=""
7+
ARG PHP_BUILD_REQUIREMENTS="build-essential dpkg-dev automake autoconf libtool file g++ gcc libc-dev make pkg-config re2c libxml2-dev libcurl4-gnutls-dev libtidy-dev libsqlite3-dev libssl-dev libxml2-dev zlib1g-dev libpng-dev liblzf-dev libreadline6-dev libfreetype6-dev libmcrypt-dev libedit-dev libltdl-dev libxslt-dev libzip-dev libsodium-dev libonig-dev gnupg2 argon2 libargon2-0 libargon2-dev libzip-dev"
8+
ARG PHP_BUILD_REQUIREMENTS_EXTRA=""
9+
ARG PHP_PECL_REQUIREMENTS="redis igbinary"
10+
ARG PHP_CONFIGURE_ARGS="--enable-soap --enable-intl"
11+
ARG PHP_CONFIGURE_ARGS_EXTRA=""
12+
ARG PHP_CONFIGURE_ARGS_FPM="--enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data"
13+
ARG PHP_VERSION="8.4.1"
14+
15+
ENV PHP_CFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
16+
PHP_CPPFLAGS="-fstack-protector-strong -fpic -fpie -O2" \
17+
PHP_LDFLAGS="-Wl,-O1 -Wl,--hash-style=both -pie" \
18+
PHP_VERSION="${PHP_VERSION}" \
19+
PHP_INI_DIR="/usr/local/etc/php" \
20+
PHP_SRC_DIR="/usr/src/php" \
21+
PHP_SRC_FILE="/usr/src/php.tar.gz" \
22+
PHPIZE_BUILD_REQUIREMENTS="build-essential automake autoconf libtool file g++ gcc libc-dev make pkg-config re2c libltdl-dev" \
23+
DOCUMENT_ROOT="/var/www/html" \
24+
PHP_URL="https://www.php.net/distributions/php-${PHP_VERSION}.tar.xz" \
25+
IMAGICK_VERSION="3.7.0"
26+
27+
### configure php
28+
# hadolint ignore=DL4006,SC2039,DL3003
29+
RUN set -xe; \
30+
\
31+
chmod 755 /usr/local/bin/docker-entrypoint; \
32+
/usr/local/bin/docker-install-requirements php; \
33+
ln -fs /etc/alternatives/vi /usr/bin/vim; \
34+
mkdir -p /tmp/mhsendmail; \
35+
cd /tmp/mhsendmail; \
36+
curl -LkSso /usr/local/bin/mhsendmail 'https://github.com/mailhog/mhsendmail/releases/download/v0.2.0/mhsendmail_linux_amd64'&& \
37+
chmod 0755 /usr/local/bin/mhsendmail; \
38+
chmod +x /usr/local/bin/mhsendmail; \
39+
mkdir -p "${PHP_INI_DIR}/conf.d"; \
40+
mkdir -p /usr/src; \
41+
cd /usr/src; \
42+
curl -fsSL -o php.tar.xz "$PHP_URL"; \
43+
docker-php-source extract; \
44+
gnuArch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)"; \
45+
debMultiarch="$(dpkg-architecture --query DEB_BUILD_MULTIARCH)"; \
46+
if [ ! -d "/usr/include/curl" ]; then \
47+
ln -sT "/usr/include/${debMultiarch}/curl" /usr/local/include/curl; \
48+
fi; \
49+
cd /usr/src/php; \
50+
export \
51+
CFLAGS="$PHP_CFLAGS" \
52+
CPPFLAGS="$PHP_CPPFLAGS" \
53+
LDFLAGS="$PHP_LDFLAGS" \
54+
; \
55+
./configure \
56+
--build="$gnuArch" \
57+
--with-config-file-path="$PHP_INI_DIR" \
58+
--with-config-file-scan-dir="$PHP_INI_DIR/conf.d" \
59+
--enable-option-checking=fatal \
60+
--disable-cgi \
61+
--with-pdo-mysql=mysqlnd \
62+
--enable-mysqlnd \
63+
--with-mhash \
64+
--enable-ftp \
65+
--enable-mbstring \
66+
--with-curl \
67+
--with-libedit \
68+
--with-openssl \
69+
--with-zlib \
70+
--enable-exif \
71+
--enable-bcmath \
72+
--enable-sockets \
73+
--with-xsl \
74+
--enable-pcntl \
75+
--with-sodium \
76+
--with-tidy \
77+
--enable-gd \
78+
--with-jpeg \
79+
--with-freetype \
80+
${PHP_CONFIGURE_ARGS:-} \
81+
${PHP_CONFIGURE_ARGS_EXTRA:-} \
82+
${PHP_CONFIGURE_ARGS_FPM:-} \
83+
; \
84+
make -j "$(nproc)"; \
85+
make install;
86+
RUN set -xe; \
87+
\
88+
mkdir -p /usr/src/php/ext/imagick; \
89+
curl -fsSL https://github.com/Imagick/imagick/archive/refs/tags/${IMAGICK_VERSION}.tar.gz | tar xvz -C "/usr/src/php/ext/imagick" --strip 1; \
90+
docker-php-ext-install imagick gd zip; \
91+
curl -fsSL https://github.com/FriendsOfPHP/pickle/releases/latest/download/pickle.phar -o pickle.phar; \
92+
chmod +x pickle.phar; \
93+
mv pickle.phar /usr/local/bin/pickle; \
94+
pickle install redis; \
95+
pickle install igbinary; \
96+
pickle install xdebug; \
97+
docker-php-ext-enable opcache redis igbinary imagick gd; \
98+
docker-php-source delete;
99+
RUN set -xe; \
100+
\
101+
# for some reason, upstream's php-fpm.conf.default has "include=NONE/etc/php-fpm.d/*.conf"
102+
sed 's!=NONE/!=!g' /usr/local/etc/php-fpm.conf.default | tee /usr/local/etc/php-fpm.conf > /dev/null; \
103+
cp /usr/local/etc/php-fpm.d/www.conf.default /usr/local/etc/php-fpm.d/www.conf; \
104+
{ \
105+
echo '[global]'; \
106+
echo 'error_log = /proc/self/fd/2'; \
107+
echo; \
108+
echo '[www]'; \
109+
echo '; if we send this to /proc/self/fd/1, it never appears'; \
110+
echo 'access.log = /proc/self/fd/2'; \
111+
echo; \
112+
echo 'clear_env = no'; \
113+
echo; \
114+
echo '; Ensure worker stdout and stderr are sent to the main error log.'; \
115+
echo 'catch_workers_output = yes'; \
116+
} | tee /usr/local/etc/php-fpm.d/docker.conf; \
117+
{ \
118+
echo '[global]'; \
119+
echo 'daemonize = no'; \
120+
echo; \
121+
echo '[www]'; \
122+
echo 'listen = 9000'; \
123+
echo 'pm.max_children = 10'; \
124+
echo 'pm.min_spare_servers = 2'; \
125+
echo 'pm.max_spare_servers = 5'; \
126+
echo 'pm.status_path = /status'; \
127+
} | tee /usr/local/etc/php-fpm.d/zz-docker.conf; \
128+
/usr/local/bin/docker-layer-clean
129+
130+
## configure php extensions
131+
# hadolint ignore=DL4006,SC2086,DL3003
132+
RUN set -xe; \
133+
\
134+
################################################
135+
## install Composer 2 as default
136+
################################################
137+
COMPOSER_DOWNLOAD_LATEST=$(curl -s https://api.github.com/repos/composer/composer/releases/latest | jq --raw-output '.assets[] | .browser_download_url' | head -n 1) ; \
138+
docker-package-download -o /usr/local/bin/composer ${COMPOSER_DOWNLOAD_LATEST}; \
139+
chmod +x /usr/local/bin/composer; \
140+
composer selfupdate; \
141+
################################################
142+
## install Composer 1
143+
################################################
144+
docker-package-download -o /usr/local/bin/composer1 https://getcomposer.org/composer-1.phar; \
145+
chmod +x /usr/local/bin/composer1; \
146+
composer1 selfupdate; \
147+
################################################
148+
## install magerun
149+
################################################
150+
curl -s -f -L -o /usr/local/bin/magerun https://files.magerun.net/n98-magerun.phar; \
151+
chmod +x /usr/local/bin/magerun; \
152+
################################################
153+
## install magerun2
154+
################################################
155+
curl -s -f -L -o /usr/local/bin/magerun2 https://files.magerun.net/n98-magerun2.phar; \
156+
chmod +x /usr/local/bin/magerun2; \
157+
/usr/local/bin/docker-layer-clean
158+
159+
WORKDIR /var/www/html
160+
ENTRYPOINT ["docker-entrypoint"]
161+
CMD ["php-fpm"]
162+
EXPOSE 9000
163+
164+
FROM php AS toolbox
165+
166+
ARG TOOLBOX_RUNTIME_REQUIREMENTS="curl git redis-tools mariadb-client percona-toolkit rsync openssh-client vim.tiny"
167+
ARG TOOLBOX_RUNTIME_REQUIREMENTS_EXTRA=""
168+
ARG TOOLBOX_BUILD_REQUIREMENTS=""
169+
ARG TOOLBOX_BUILD_REQUIREMENTS_EXTRA=""
170+
171+
# hadolint ignore=DL4006
172+
RUN set -xe; \
173+
\
174+
/usr/local/bin/docker-install-requirements toolbox; \
175+
curl https://rclone.org/install.sh | bash; \
176+
composer require deployer/deployer; \
177+
composer update; \
178+
echo "export PATH=$PATH:/var/www/html/vendor/bin" >> /etc/profile; \
179+
/usr/local/bin/docker-layer-clean
180+
181+
CMD ["php", "-a"]

0 commit comments

Comments
 (0)