Skip to content

Commit

Permalink
build latest images of PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
deminy committed Nov 25, 2024
1 parent ab11526 commit 51bdc73
Show file tree
Hide file tree
Showing 5 changed files with 85 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ Note: We don't have development tools built in for Alpine images. There is no Do

| PHP Versions | Default Images | Dev Images | Alpine Images |
|-|-|-|-|
| PHP 8.4 | [php8.4](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.4/cli/Dockerfile) | [php8.4-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.4/cli/Dockerfile) | [php8.4-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.4/alpine/Dockerfile) |
| PHP 8.3 | [php8.3](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.3/cli/Dockerfile) | [php8.3-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.3/cli/Dockerfile) | [php8.3-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.3/alpine/Dockerfile) |
| PHP 8.2 | [php8.2](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.2/cli/Dockerfile) | [php8.2-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.2/cli/Dockerfile) | [php8.2-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.2/alpine/Dockerfile) |
| PHP 8.1 | [php8.1](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.1/cli/Dockerfile) | [php8.1-dev](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.1/cli/Dockerfile) | [php8.1-alpine](https://github.com/swoole/docker-swoole/blob/master/dockerfiles/nightly/php8.1/alpine/Dockerfile) |
Expand Down
1 change: 1 addition & 0 deletions config/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ php:
- "8.1"
- "8.2"
- "8.3"
- "8.4"
image:
composer:
version: "2.8.2"
Expand Down
32 changes: 32 additions & 0 deletions dockerfiles/nightly/php8.4/alpine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
FROM php:8.4-cli-alpine3.20

COPY --from=composer:2.8.2 /usr/bin/composer /usr/bin/

RUN \
set -ex && \
apk update && \
apk add --no-cache libstdc++ libpq && \
apk add --no-cache --virtual .build-deps $PHPIZE_DEPS curl-dev linux-headers brotli-dev postgresql-dev openssl-dev pcre-dev pcre2-dev zlib-dev && \
# PHP extension pdo_mysql is included since 4.8.12+ and 5.0.1+.
docker-php-ext-install pdo_mysql && \
pecl channel-update pecl.php.net && \
pecl install --configureoptions 'enable-redis-igbinary="no" enable-redis-lzf="no" enable-redis-zstd="no"' redis-6.1.0 && \
# PHP extension Redis is included since 4.8.12+ and 5.0.1+.
docker-php-ext-enable redis && \
docker-php-ext-install sockets && \
docker-php-source extract && \
mkdir /usr/src/php/ext/swoole && \
curl -sfL https://github.com/swoole/swoole-src/archive/master.tar.gz -o swoole.tar.gz && \
tar xfz swoole.tar.gz --strip-components=1 -C /usr/src/php/ext/swoole && \
docker-php-ext-configure swoole \
--enable-mysqlnd \
--enable-swoole-pgsql \
--enable-brotli \
--enable-openssl \
--enable-sockets --enable-swoole-curl && \
docker-php-ext-install -j$(nproc) swoole && \
rm -f swoole.tar.gz && \
docker-php-source delete && \
apk del .build-deps

WORKDIR "/var/www/"
50 changes: 50 additions & 0 deletions dockerfiles/nightly/php8.4/cli/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
FROM php:8.4-cli

ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm-color

ARG DEV_MODE
ENV DEV_MODE=$DEV_MODE

COPY --from=composer:2.8.2 /usr/bin/composer /usr/bin/
COPY ./rootfilesystem/ /

RUN \
set -ex && \
apt-get update && \
apt-get install -y \
# The auto-reloading feature is supported for non-Alpine images only.
#
# Package "inotify-tools" is pre-installed in latest non-Alpine images. For versioned non-Alpine images, it will be
# installed automatically when needed. For details, please check script "autoreload.sh" and example "00-autoreload".
#
# @see https://github.com/swoole/docker-swoole/blob/master/rootfilesystem/usr/local/boot/autoreload.sh
# @see https://github.com/swoole/docker-swoole/tree/master/examples/00-autoreload
inotify-tools \
libcurl4-openssl-dev \
libbrotli-dev \
libpq-dev \
libssl-dev \
supervisor \
unzip \
zlib1g-dev \
--no-install-recommends && \
# PHP extension pdo_mysql is included since 4.8.12+ and 5.0.1+.
docker-php-ext-install pdo_mysql && \
pecl channel-update pecl.php.net && \
pecl install --configureoptions 'enable-redis-igbinary="no" enable-redis-lzf="no" enable-redis-zstd="no"' redis-6.1.0 && \
# PHP extension Redis is included since 4.8.12+ and 5.0.1+.
docker-php-ext-enable redis && \
install-swoole.sh master \
--enable-mysqlnd \
--enable-swoole-pgsql \
--enable-brotli \
--enable-openssl \
--enable-sockets --enable-swoole-curl && \
mkdir -p /var/log/supervisor && \
rm -rf /var/lib/apt/lists/* /usr/bin/qemu-*-static

ENTRYPOINT ["/entrypoint.sh"]
CMD []

WORKDIR "/var/www/"
1 change: 1 addition & 0 deletions src/Dockerfile.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ class Dockerfile
'8.1' => '3.20',
'8.2' => '3.20',
'8.3' => '3.20',
'8.4' => '3.20',
];

protected string $basePath;
Expand Down

0 comments on commit 51bdc73

Please sign in to comment.