From 8c38e7bf79aa23076b6e492b1e8d65a3951f1825 Mon Sep 17 00:00:00 2001 From: Jose Quintana Date: Wed, 3 Jan 2024 21:52:07 +0100 Subject: [PATCH] refactor: build few extensions under `/opt` dir --- 8.1-fpm/Dockerfile | 9 +++++---- 8.2-fpm/Dockerfile | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/8.1-fpm/Dockerfile b/8.1-fpm/Dockerfile index 88ca6cd..a1463f0 100644 --- a/8.1-fpm/Dockerfile +++ b/8.1-fpm/Dockerfile @@ -168,8 +168,8 @@ RUN set -eux \ && true \ \ # Install lz4 - && git clone https://github.com/kjdev/php-ext-lz4 /tmp/lz4 \ - && cd /tmp/lz4 \ + && git clone https://github.com/kjdev/php-ext-lz4 /opt/lz4 \ + && cd /opt/lz4 \ && git checkout $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1) \ && phpize \ && ./configure --enable-lz4 --with-lz4-includedir=/usr \ @@ -226,8 +226,8 @@ RUN set -eux \ && true \ \ # Install phalcon - && git clone --depth=1 --branch=v${PHALCON_VERSION} https://github.com/phalcon/cphalcon.git /tmp/phalcon \ - && cd /tmp/phalcon/build \ + && git clone --depth=1 --branch=v${PHALCON_VERSION} https://github.com/phalcon/cphalcon.git /opt/phalcon \ + && cd /opt/phalcon/build \ && sh ./install \ && docker-php-ext-enable phalcon \ && true \ @@ -345,6 +345,7 @@ RUN set -eux \ # Clean up build packages && docker-php-source delete \ && apk del .build-deps \ + && rm -rf /tmp/* \ && true RUN set -eux \ diff --git a/8.2-fpm/Dockerfile b/8.2-fpm/Dockerfile index 57684f5..fed670a 100644 --- a/8.2-fpm/Dockerfile +++ b/8.2-fpm/Dockerfile @@ -168,8 +168,8 @@ RUN set -eux \ && true \ \ # Install lz4 - && git clone https://github.com/kjdev/php-ext-lz4 /tmp/lz4 \ - && cd /tmp/lz4 \ + && git clone https://github.com/kjdev/php-ext-lz4 /opt/lz4 \ + && cd /opt/lz4 \ && git checkout $(git tag | grep -E '^[.0-9]+$' | sort -V | tail -1) \ && phpize \ && ./configure --enable-lz4 --with-lz4-includedir=/usr \ @@ -220,8 +220,8 @@ RUN set -eux \ && true \ \ # Install phalcon - && git clone --depth=1 --branch=v${PHALCON_VERSION} https://github.com/phalcon/cphalcon.git /tmp/phalcon \ - && cd /tmp/phalcon/build \ + && git clone --depth=1 --branch=v${PHALCON_VERSION} https://github.com/phalcon/cphalcon.git /opt/phalcon \ + && cd /opt/phalcon/build \ && sh ./install \ && docker-php-ext-enable phalcon \ && true \ @@ -339,6 +339,7 @@ RUN set -eux \ # Clean up build packages && docker-php-source delete \ && apk del .build-deps \ + && rm -rf /tmp/* \ && true RUN set -eux \