From 091e7a07a10346127113156f82a555e8439f0994 Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Fri, 6 Dec 2024 11:35:07 -0600 Subject: [PATCH 1/4] Adding new Dockerfile --- 8.4.Dockerfile | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 8.4.Dockerfile diff --git a/8.4.Dockerfile b/8.4.Dockerfile new file mode 100644 index 0000000..a512eea --- /dev/null +++ b/8.4.Dockerfile @@ -0,0 +1,56 @@ +FROM php:8.4.1-fpm-alpine3.20 + +MAINTAINER Jitendra Adhikari + +ENV \ + LD_PRELOAD=/usr/lib/preloadable_libiconv.so \ + PECL_EXTENSIONS="apcu ast ds ev igbinary lzf memcached mongodb msgpack oauth pcov \ + psr redis rdkafka simdjson ssh2-1.3.1 uuid xdebug xhprof xlswriter yaml" \ + PHP_EXTENSIONS="bcmath bz2 calendar exif gd gettext gmp imap intl ldap mysqli pcntl pdo_mysql pgsql \ + pdo_pgsql pspell shmop soap sysvshm sysvmsg sysvsem tidy xsl zip" \ + PECL_EXTENSIONS_FUTURE="grpc imagick yaf" \ + PHP_EXTENSIONS_FUTURE="intl sockets" + +# docker-* +COPY docker-* /usr/local/bin/ + +# copy from existing +COPY --from=adhocore/phpfpm:8.4 /usr/local/lib/php/extensions/no-debug-non-zts-20230831/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=adhocore/phpfpm:8.4 /usr/local/etc/php/conf.d/*.ini /usr/local/etc/php/conf.d/ + +# ext +COPY ext.php /ext.php + +RUN \ +# deps + apk add -U --no-cache --virtual temp \ + # dev deps + autoconf g++ file re2c make zlib-dev libtool aspell-dev pcre-dev libxml2-dev bzip2-dev libzip-dev \ + icu-dev gettext-dev imagemagick-dev openldap-dev libpng-dev gmp-dev yaml-dev postgresql-dev \ + libxml2-dev tidyhtml-dev libmemcached-dev libssh2-dev libevent-dev libev-dev librdkafka-dev lua-dev libxslt-dev \ + freetype-dev jpeg-dev libjpeg-turbo-dev oniguruma-dev \ + # prod deps + && apk add --no-cache aspell gettext gnu-libiconv grpc \ + icu imagemagick libjpeg imap-dev libzip libbz2 librdkafka libxml2-utils libpq \ + libmemcached libssh2 libevent libev libxslt linux-headers lua openldap \ + openldap-back-mdb tidyhtml yaml zlib \ +# +# php extensions + && docker-php-source extract \ + && docker-php-ext-remove intl || true \ + && pecl channel-update pecl.php.net \ + && { php -m | grep gd || docker-php-ext-configure gd --with-freetype --with-jpeg --enable-gd; } \ + && docker-php-ext-install-if $PHP_EXTENSIONS \ + && docker-pecl-ext-install $PECL_EXTENSIONS \ + && { docker-php-ext-enable $(echo $PECL_EXTENSIONS | sed -E 's/\-[^ ]+//g') opcache > /dev/null || true; } \ + && { php -m | grep xdebug && docker-php-ext-disable xdebug || true; } \ + && docker-php-source delete \ +# +# composer + && curl -sSL https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer \ + && curl -sSL https://getcomposer.org/installer | php -- --1 --install-dir=/usr/local/bin --filename=composer1 \ +# +# cleanup + && apk del temp \ + && rm -rf /var/cache/apk/* /tmp/* /var/tmp/* /usr/share/doc/* /usr/share/man/* \ + && php -f /ext.php From 6e6e9342b2955aaab6062087dd9bdb20b5efab95 Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Fri, 6 Dec 2024 11:37:47 -0600 Subject: [PATCH 2/4] Updating github actions config --- .github/workflows/build.yml | 10 ++++++++++ .github/workflows/build_preview.yml | 6 +++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5685680..8a4fd8c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,16 @@ jobs: docker pull adhocore/phpfpm:8.1 || true docker pull adhocore/phpfpm:8.2 || true docker pull adhocore/phpfpm:8.3 || true + docker pull adhocore/phpfpm:8.4 || true + + - name: "[8.4] Build and push" + id: docker_build_84 + uses: docker/build-push-action@v4 + with: + push: true + file: 8.4.Dockerfile + tags: adhocore/phpfpm:8.4,adhocore/phpfpm:latest + platforms: linux/amd64,linux/arm64 - name: "[8.3] Build and push" id: docker_build_83 diff --git a/.github/workflows/build_preview.yml b/.github/workflows/build_preview.yml index c6a08a9..41c73c4 100644 --- a/.github/workflows/build_preview.yml +++ b/.github/workflows/build_preview.yml @@ -19,11 +19,11 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: "[8.3r] Build and push" - id: docker_build_83 + - name: "[8.4] Build and push" + id: docker_build_84 uses: docker/build-push-action@v4 with: push: true file: 8.3.Dockerfile - tags: adhocore/phpfpm:8.3r,adhocore/phpfpm:8.3rc + tags: adhocore/phpfpm:8.4,adhocore/phpfpm:8.4 platforms: linux/amd64,linux/arm64 From 806ee50c4b93a88a1367f4422fd4f19dfeb762c9 Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Fri, 6 Dec 2024 11:39:55 -0600 Subject: [PATCH 3/4] Updating docs --- README.md | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 209d31c..3cb051d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Check [example](#extensions) below how to add them back in your images based off Docker PHP FPM with lean alpine base. The download size is just about **~100MB** - tiny given how many extensions it has baked in. -It contains PHP>=8.3.4, PHP>=8.2.17, PHP>=8.1.27 and PHP>=8.0.30 with plenty of common and useful extensions. +It contains PHP>=8.4.1, PHP>=8.3.4, PHP>=8.2.17, PHP>=8.1.27 and PHP>=8.0.30 with plenty of common and useful extensions. If you are looking for a complete local development stack then check [`adhocore/lemp`](https://github.com/adhocore/docker-lemp). @@ -26,6 +26,9 @@ The images are always latest, everytime a new PHP version comes out and its offi To pull latest image: ```sh +# for php >=8.4.1 +docker pull adhocore/phpfpm:8.4 + # for php >=8.3.4 docker pull adhocore/phpfpm:8.3 @@ -72,7 +75,7 @@ Latest versions of both Composer v1 and v2 are installed already. You can run v2 You can add new extensions in your image like so: ```Dockerfile -FROM adhocore/phpfpm:8.3 # or 8.2, 8.1 +FROM adhocore/phpfpm:8.4 # or 8.3, 8.2 RUN \ # setup @@ -94,6 +97,27 @@ just run `docker-php-ext-enable xdebug` to enable it again without having to reb Below you can find list of extensions by image tags. +### PHP8.4 + +``` +PHP 8.4.1, Total extensions: 60 +- bcmath - bz2 - calendar - core +- ctype - curl - date - dom +- exif - fileinfo - filter - fpm +- ftp - gd - gettext - gmp +- hash - iconv - imap - intl +- json - ldap - libxml - mbstring +- mysqli - mysqlnd - openssl - pcntl +- pcre - pdo - pdo_mysql - pdo_pgsql +- pdo_sqlite - pgsql - phar - posix +- pspell - random - readline - reflection +- session - shmop - simplexml - soap +- sodium - spl - sqlite3 - standard +- sysvmsg - sysvsem - sysvshm - tidy +- tokenizer - xdebug - xml - xmlreader +- xmlwriter - xsl - zip - zlib +``` + ### PHP8.3 ``` @@ -238,10 +262,10 @@ Read more about ### Production Usage For production you may want to get rid of some extensions that are not really required. -In such case, you can build a custom image on top `adhocore/phpfpm:8.2` like so: +In such case, you can build a custom image on top `adhocore/phpfpm:8.4` like so: ```Dockerfile -FROM adhocore/phpfpm:8.2 # or 8.1 or 8.0 +FROM adhocore/phpfpm:8.4 # or 8.3 or 8.2 # Disable extensions you won't need. You can add as much as you want separated by space. RUN docker-php-ext-disable xdebug pcov ldap From 2faf95cbdc000c33f0621a7ab68b4cab6366e57a Mon Sep 17 00:00:00 2001 From: Luis Gonzalez Date: Wed, 11 Dec 2024 23:14:50 -0600 Subject: [PATCH 4/4] Update 8.4.Dockerfile --- 8.4.Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/8.4.Dockerfile b/8.4.Dockerfile index a512eea..11736b5 100644 --- a/8.4.Dockerfile +++ b/8.4.Dockerfile @@ -15,8 +15,8 @@ ENV \ COPY docker-* /usr/local/bin/ # copy from existing -COPY --from=adhocore/phpfpm:8.4 /usr/local/lib/php/extensions/no-debug-non-zts-20230831/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ -COPY --from=adhocore/phpfpm:8.4 /usr/local/etc/php/conf.d/*.ini /usr/local/etc/php/conf.d/ +# COPY --from=adhocore/phpfpm:8.4 /usr/local/lib/php/extensions/no-debug-non-zts-20230831/*.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/## +# COPY --from=adhocore/phpfpm:8.4 /usr/local/etc/php/conf.d/*.ini /usr/local/etc/php/conf.d/ # ext COPY ext.php /ext.php