diff --git a/php-8.3/Dockerfile b/php-8.3/Dockerfile index a348b26..4c8e3c1 100644 --- a/php-8.3/Dockerfile +++ b/php-8.3/Dockerfile @@ -4,8 +4,12 @@ ENV PHP_REDIS_VERSION="6.0.2" \ PHP_SWOOLE_VERSION="v5.1.2" \ PHP_IMAGICK_VERSION="3.7.0" \ PHP_YAML_VERSION="2.2.3" \ + PHP_MAXMINDDB_VERSION="v1.11.1" \ PHP_SCRYPT_VERSION="2.0.1" \ + PHP_ZSTD_VERSION="0.13.3" \ PHP_BROTLI_VERSION="0.15.0" \ + PHP_SNAPPY_VERSION="c27f830dcfe6c41eb2619a374de10fd0597f4939" \ + PHP_LZ4_VERSION="2f006c3e4f1fb3a60d2656fc164f9ba26b71e995" \ PHP_XDEBUG_VERSION="3.3.1" RUN \ @@ -27,7 +31,9 @@ RUN \ jpeg-dev \ libjxl-dev \ libmaxminddb-dev \ + zstd-dev \ brotli-dev \ + lz4-dev \ curl-dev RUN docker-php-ext-install sockets @@ -69,6 +75,25 @@ RUN \ ./configure && \ make && make install +## Maxminddb extension +FROM compile AS maxmind +RUN \ + git clone --depth 1 --branch $PHP_MAXMINDDB_VERSION https://github.com/maxmind/MaxMind-DB-Reader-php.git && \ + cd MaxMind-DB-Reader-php && \ + cd ext && \ + phpize && \ + ./configure && \ + make && make install + +# Zstd Compression +FROM compile as zstd +RUN git clone --recursive -n https://github.com/kjdev/php-ext-zstd.git \ + && cd php-ext-zstd \ + && git checkout $PHP_ZSTD_VERSION \ + && phpize \ + && ./configure --with-libzstd \ + && make && make install + ## Brotli Extension FROM compile as brotli RUN git clone https://github.com/kjdev/php-ext-brotli.git \ @@ -78,6 +103,24 @@ RUN git clone https://github.com/kjdev/php-ext-brotli.git \ && ./configure --with-libbrotli \ && make && make install +## LZ4 Extension +FROM compile AS lz4 +RUN git clone --recursive https://github.com/kjdev/php-ext-lz4.git \ + && cd php-ext-lz4 \ + && git reset --hard $PHP_LZ4_VERSION \ + && phpize \ + && ./configure --with-lz4-includedir=/usr \ + && make && make install + +## Snappy Extension +FROM compile AS snappy +RUN git clone --recursive https://github.com/kjdev/php-ext-snappy.git \ + && cd php-ext-snappy \ + && git reset --hard $PHP_SNAPPY_VERSION \ + && phpize \ + && ./configure \ + && make && make install + ## Scrypt Extension FROM compile AS scrypt RUN git clone --depth 1 https://github.com/DomBlack/php-scrypt.git \ @@ -104,9 +147,11 @@ RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone RUN \ apk update \ - apk add --no-cache \ + && apk add --no-cache \ + linux-headers \ rsync \ brotli-dev \ + lz4-dev \ yaml-dev \ imagemagick \ libjpeg-turbo \ @@ -114,13 +159,11 @@ RUN \ libavif \ libheif \ imagemagick-heic \ - certbot \ - docker-cli \ libgomp \ git \ - && docker-php-ext-install sockets intl \ - && apk del .deps \ && rm -rf /var/cache/apk/* + +RUN docker-php-ext-install sockets WORKDIR /usr/src/code @@ -129,7 +172,10 @@ COPY --from=redis /usr/local/lib/php/extensions/no-debug-non-zts-20230831/redis. COPY --from=imagick /usr/local/lib/php/extensions/no-debug-non-zts-20230831/imagick.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=yaml /usr/local/lib/php/extensions/no-debug-non-zts-20230831/yaml.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=scrypt /usr/local/lib/php/extensions/no-debug-non-zts-20230831/scrypt.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=zstd /usr/local/lib/php/extensions/no-debug-non-zts-20230831/zstd.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=brotli /usr/local/lib/php/extensions/no-debug-non-zts-20230831/brotli.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=lz4 /usr/local/lib/php/extensions/no-debug-non-zts-20230831/lz4.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ +COPY --from=snappy /usr/local/lib/php/extensions/no-debug-non-zts-20230831/snappy.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ COPY --from=xdebug /usr/local/lib/php/extensions/no-debug-non-zts-20230831/xdebug.so /usr/local/lib/php/extensions/no-debug-non-zts-20230831/ # Enable Extensions @@ -138,7 +184,10 @@ RUN echo extension=redis.so >> /usr/local/etc/php/conf.d/redis.ini RUN echo extension=imagick.so >> /usr/local/etc/php/conf.d/imagick.ini RUN echo extension=yaml.so >> /usr/local/etc/php/conf.d/yaml.ini RUN echo extension=scrypt.so >> /usr/local/etc/php/conf.d/scrypt.ini +RUN echo extension=zstd.so >> /usr/local/etc/php/conf.d/zstd.ini RUN echo extension=brotli.so >> /usr/local/etc/php/conf.d/brotli.ini +RUN echo extension=lz4.so >> /usr/local/etc/php/conf.d/lz4.ini +RUN echo extension=snappy.so >> /usr/local/etc/php/conf.d/snappy.ini EXPOSE 80 diff --git a/tests.yml b/tests.yaml similarity index 73% rename from tests.yml rename to tests.yaml index d451c81..d6995ea 100644 --- a/tests.yml +++ b/tests.yaml @@ -17,9 +17,18 @@ fileExistenceTests: - name: 'Check scrypt extension' path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/scrypt.so shouldExist: true + - name: 'Check zstd extension' + path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/zstd.so + shouldExist: true - name: 'Check brotli extension' path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/brotli.so shouldExist: true + - name: 'Check lz4 extension' + path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/lz4.so + shouldExist: true + - name: 'Check snappy extension' + path: /usr/local/lib/php/extensions/no-debug-non-zts-20230831/snappy.so + shouldExist: true ## ini files - name: 'Check swoole ini' @@ -36,9 +45,19 @@ fileExistenceTests: shouldExist: true - name: 'Check scrypt ini' path: /usr/local/etc/php/conf.d/scrypt.ini + shouldExist: true + - name: 'Check zstd ini' + path: /usr/local/etc/php/conf.d/zstd.ini + shouldExist: true - name: 'Check brotli ini' path: /usr/local/etc/php/conf.d/brotli.ini shouldExist: true + - name: 'Check lz4 ini' + path: /usr/local/etc/php/conf.d/lz4.ini + shouldExist: true + - name: 'Check snappy ini' + path: /usr/local/etc/php/conf.d/snappy.ini + shouldExist: true fileContentTests: - name: 'swoole ini' @@ -56,9 +75,18 @@ fileContentTests: - name: 'scrypt ini' path: '/usr/local/etc/php/conf.d/scrypt.ini' expectedContents: ['extension=scrypt.so'] + - name: 'zstd ini' + path: '/usr/local/etc/php/conf.d/zstd.ini' + expectedContents: ['extension=zstd.so'] - name: 'brotli ini' path: '/usr/local/etc/php/conf.d/brotli.ini' expectedContents: ['extension=brotli.so'] + - name: 'lz4 ini' + path: '/usr/local/etc/php/conf.d/lz4.ini' + expectedContents: ['extension=lz4.so'] + - name: 'snappy ini' + path: '/usr/local/etc/php/conf.d/snappy.ini' + expectedContents: ['extension=snappy.so'] commandTests: - name: 'Imagemagick command' @@ -89,7 +117,10 @@ commandTests: - ".*curl.*" - ".*PDO.*" - ".*pdo_mysql.*" + - ".*zstd.*" - ".*brotli.*" + - ".*lz4.*" + - ".*snappy.*" - name: 'PHP intl' command: "php" args: ["-r", 'print(\Normalizer::FORM_D);']