From 018c41031a384cb993e4902db512cfa6ae358717 Mon Sep 17 00:00:00 2001 From: mc303 Date: Wed, 28 Oct 2020 20:56:26 +0100 Subject: [PATCH] Update Dockerfile --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9c05df2..5d2ca39 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,7 @@ FROM php:5.6-apache -MAINTAINER Pierre Cheynier + +ARG TARGETPLATFORM +RUN echo "TARGETPLATFORM : $TARGETPLATFORM" ENV PHPIPAM_AGENT_SOURCE https://github.com/phpipam/phpipam-agent @@ -15,7 +17,15 @@ RUN docker-php-ext-configure mysqli --with-mysqli=mysqlnd && \ docker-php-ext-install mysqli && \ docker-php-ext-install json && \ docker-php-ext-install pdo_mysql && \ - docker-php-ext-configure gmp && \ + + if [ "$TARGETPLATFORM" = "linux/386" ] ; then XARCH="i386-linux-gnu" ; fi && \ + if [ "$TARGETPLATFORM" = "linux/amd64" ] ; then XARCH="x86_64-linux-gnu" ; fi && \ + if [ "$TARGETPLATFORM" = "linux/arm/v6" ] ; then XARCH="arm-linux-gnueabi" ; fi && \ + if [ "$TARGETPLATFORM" = "linux/arm/v7" ] ; then XARCH="arm-linux-gnueabihf" ; fi && \ + if [ "$TARGETPLATFORM" = "linux/arm64" ] ; then XARCH="aarch64-linux-gnu" ; fi && \ + + ln -s /usr/include/$XARCH/gmp.h /usr/include/gmp.h && \ + docker-php-ext-configure gmp --with-gmp=/usr/include/$XARCH && \ docker-php-ext-install gmp && \ docker-php-ext-install pcntl