From adb210835c40dc41831da3e779823dafdc019a84 Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 4 Oct 2023 23:56:26 +0200 Subject: [PATCH 1/5] add ldap and sysvsem extension to static-builder --- static-builder.Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/static-builder.Dockerfile b/static-builder.Dockerfile index a8cbf88e5..3eb4312f9 100644 --- a/static-builder.Dockerfile +++ b/static-builder.Dockerfile @@ -3,7 +3,8 @@ FROM golang-base ARG FRANKENPHP_VERSION='dev' ARG PHP_VERSION='8.2' -ARG PHP_EXTENSIONS='bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,intl,mbstring,mbregex,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,apcu' +ARG PHP_EXTENSIONS='bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,intl,ldap,mbstring,mbregex,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,sysvsem,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,apcu' +ARG PHP_EXTENSION_LIBS='freetype,libjpeg,libavif,libwebp,libzip,bzip2' RUN apk update; \ apk add --no-cache \ From a9d9089e5821242b314ee8767b32257c17d4198c Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 4 Oct 2023 23:58:01 +0200 Subject: [PATCH 2/5] add lib support for static-builder to enhance enabled extensions (such as libjpeg for gd) --- docs/static.md | 6 ++++++ static-builder.Dockerfile | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/static.md b/docs/static.md index c2d7eabc1..43923bc94 100644 --- a/docs/static.md +++ b/docs/static.md @@ -33,6 +33,12 @@ docker buildx bake --load --set static-builder.args.PHP_EXTENSIONS=opcache,pdo_s See [the list of supported extensions](https://static-php-cli.zhamao.me/en/guide/extensions.html). +To enable libraries to add further support in the extensions you enabled, you can pass the `PHP_EXTENSION_LIBS` argument to docker. + +```console +docker buildx bake --load --set static-builder.args.PHP_EXTENSIONS=gd --set static-builder.args.PHP_EXTENSION_LIBS=libjpeg,libwebp static-builder +``` + ### GitHub Token If you hit the GitHub API rate limit, set a GitHub Personal Access Token in an environment variable named `GITHUB_TOKEN`: diff --git a/static-builder.Dockerfile b/static-builder.Dockerfile index 3eb4312f9..9b9c0c768 100644 --- a/static-builder.Dockerfile +++ b/static-builder.Dockerfile @@ -58,7 +58,7 @@ RUN git clone --depth=1 https://github.com/crazywhalecc/static-php-cli . && \ RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./bin/spc download --with-php=$PHP_VERSION --all -RUN ./bin/spc build --build-embed --enable-zts "$PHP_EXTENSIONS" +RUN ./bin/spc build --build-embed --enable-zts "$PHP_EXTENSIONS" --with-libs="$PHP_EXTENSION_LIBS" ENV PATH="/static-php-cli/buildroot/bin:/static-php-cli/buildroot/usr/bin:$PATH" From 1041cf0224155cd0fe7fbf3fb4213dcc83bb4cbb Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 1 Nov 2023 10:19:25 +0100 Subject: [PATCH 3/5] disable opcache-jit --- static-builder.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-builder.Dockerfile b/static-builder.Dockerfile index 9b9c0c768..65fb1187b 100644 --- a/static-builder.Dockerfile +++ b/static-builder.Dockerfile @@ -58,7 +58,7 @@ RUN git clone --depth=1 https://github.com/crazywhalecc/static-php-cli . && \ RUN --mount=type=secret,id=github-token GITHUB_TOKEN=$(cat /run/secrets/github-token) ./bin/spc download --with-php=$PHP_VERSION --all -RUN ./bin/spc build --build-embed --enable-zts "$PHP_EXTENSIONS" --with-libs="$PHP_EXTENSION_LIBS" +RUN ./bin/spc build --build-embed --enable-zts --disable-opcache-jit "$PHP_EXTENSIONS" --with-libs="$PHP_EXTENSION_LIBS" ENV PATH="/static-php-cli/buildroot/bin:/static-php-cli/buildroot/usr/bin:$PATH" From 9883733d42937a6bb766b546da2a9bfcf23381bd Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Wed, 1 Nov 2023 10:41:22 +0100 Subject: [PATCH 4/5] include bz2, order alphabetically --- static-builder.Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static-builder.Dockerfile b/static-builder.Dockerfile index 65fb1187b..c0648f748 100644 --- a/static-builder.Dockerfile +++ b/static-builder.Dockerfile @@ -3,7 +3,7 @@ FROM golang-base ARG FRANKENPHP_VERSION='dev' ARG PHP_VERSION='8.2' -ARG PHP_EXTENSIONS='bcmath,calendar,ctype,curl,dba,dom,exif,filter,fileinfo,gd,iconv,intl,ldap,mbstring,mbregex,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,sysvsem,tokenizer,xml,xmlreader,xmlwriter,zip,zlib,apcu' +ARG PHP_EXTENSIONS='apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,exif,fileinfo,filter,gd,iconv,intl,ldap,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,posix,readline,redis,session,simplexml,sockets,sqlite3,sysvsem,tokenizer,xml,xmlreader,xmlwriter,zip,zlib' ARG PHP_EXTENSION_LIBS='freetype,libjpeg,libavif,libwebp,libzip,bzip2' RUN apk update; \ From 2f50d5d6b91afa2472d2c2293b4d329ee8668761 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 1 Nov 2023 14:06:07 +0100 Subject: [PATCH 5/5] Update static.md --- docs/static.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/static.md b/docs/static.md index 9f39fe1a3..bcb6cfce8 100644 --- a/docs/static.md +++ b/docs/static.md @@ -33,10 +33,14 @@ docker buildx bake --load --set static-builder.args.PHP_EXTENSIONS=opcache,pdo_s See [the list of supported extensions](https://static-php.dev/en/guide/extensions.html). -To enable libraries to add further support in the extensions you enabled, you can pass the `PHP_EXTENSION_LIBS` argument to docker. +To add libraries enabling additional functionality to the extensions you've enabled, you can pass use the `PHP_EXTENSION_LIBS` Docker ARG: ```console -docker buildx bake --load --set static-builder.args.PHP_EXTENSIONS=gd --set static-builder.args.PHP_EXTENSION_LIBS=libjpeg,libwebp static-builder +docker buildx bake \ + --load \ + --set static-builder.args.PHP_EXTENSIONS=gd \ + --set static-builder.args.PHP_EXTENSION_LIBS=libjpeg,libwebp \ + static-builder ``` ### GitHub Token