diff --git a/Dockerfile b/Dockerfile index 96efb75..928ea43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,10 @@ FROM php:8.0-apache-buster +# So we can use it anywhere for conditional stuff. Keeping BC with old (non-buildkit, builders) +ARG TARGETPLATFORM +ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64} +RUN echo "Building for ${TARGETPLATFORM}" + ADD root/ / # Fix the original permissions of /tmp, the PHP default upload tmp dir. RUN chmod 777 /tmp && chmod +t /tmp diff --git a/root/tmp/setup/oci8-extension.sh b/root/tmp/setup/oci8-extension.sh index 4048072..5f819c2 100755 --- a/root/tmp/setup/oci8-extension.sh +++ b/root/tmp/setup/oci8-extension.sh @@ -2,6 +2,11 @@ set -e +if [[ ${TARGETPLATFORM} != "linux/amd64" ]]; then + echo "oracle extension not available for ${TARGETPLATFORM} architecture, skipping" + exit 0 +fi + echo "Downloading oracle files" curl https://download.oracle.com/otn_software/linux/instantclient/19600/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip \ -o /tmp/instantclient-basic-linux.x64-19.6.0.0.0dbru.zip diff --git a/root/tmp/setup/php-extensions.sh b/root/tmp/setup/php-extensions.sh index c41e08b..1b9878e 100755 --- a/root/tmp/setup/php-extensions.sh +++ b/root/tmp/setup/php-extensions.sh @@ -60,7 +60,7 @@ docker-php-ext-configure gd --with-freetype=/usr/include/ --with-jpeg=/usr/inclu docker-php-ext-install -j$(nproc) gd # LDAP. -docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ +docker-php-ext-configure ldap docker-php-ext-install -j$(nproc) ldap # APCu, igbinary, Memcached, MongoDB, Redis, Solr, uuid, XMLRPC (beta) @@ -72,7 +72,11 @@ echo 'apc.enable_cli = On' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini # Install Microsoft dependencies for sqlsrv. # (kept apart for clarity, still need to be run here # before some build packages are deleted) -/tmp/setup/sqlsrv-extension.sh +if [[ ${TARGETPLATFORM} == "linux/amd64" ]]; then + /tmp/setup/sqlsrv-extension.sh +else + echo "sqlsrv extension not available for ${TARGETPLATFORM} architecture, skipping" +fi # Keep our image size down.. pecl clear-cache