diff --git a/services/backup/Dockerfile b/services/backup/Dockerfile --- a/services/backup/Dockerfile +++ b/services/backup/Dockerfile @@ -1,4 +1,5 @@ -FROM commapp/services-base:1.1 +ARG COMM_BASE_IMAGE_M1_SUFFIX +FROM commapp/services-base:1.1${COMM_BASE_IMAGE_M1_SUFFIX} RUN apt-get update && \ apt-get install -y uuid-dev && \ diff --git a/services/blob/Dockerfile b/services/blob/Dockerfile --- a/services/blob/Dockerfile +++ b/services/blob/Dockerfile @@ -1,4 +1,5 @@ -FROM commapp/services-base:1.1 +ARG COMM_BASE_IMAGE_M1_SUFFIX +FROM commapp/services-base:1.1${COMM_BASE_IMAGE_M1_SUFFIX} RUN apt-get update && \ apt-get install -y uuid-dev && \ diff --git a/services/docker-compose.yml b/services/docker-compose.yml --- a/services/docker-compose.yml +++ b/services/docker-compose.yml @@ -11,6 +11,7 @@ dockerfile: services/tunnelbroker/Dockerfile context: ../ args: + - COMM_BASE_IMAGE_M1_SUFFIX=${COMM_BASE_IMAGE_M1_SUFFIX} - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/tunnelbroker-server:0.2 @@ -29,6 +30,7 @@ dockerfile: services/backup/Dockerfile context: ../ args: + - COMM_BASE_IMAGE_M1_SUFFIX=${COMM_BASE_IMAGE_M1_SUFFIX} - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/backup-server:0.1 @@ -44,6 +46,7 @@ dockerfile: services/blob/Dockerfile context: ../ args: + - COMM_BASE_IMAGE_M1_SUFFIX=${COMM_BASE_IMAGE_M1_SUFFIX} - COMM_TEST_SERVICES=${COMM_TEST_SERVICES} - COMM_SERVICES_DEV_MODE=${COMM_SERVICES_DEV_MODE} image: commapp/blob-server:0.1 diff --git a/services/scripts/build_base_image.sh b/services/scripts/build_base_image.sh --- a/services/scripts/build_base_image.sh +++ b/services/scripts/build_base_image.sh @@ -7,5 +7,10 @@ exit 1 fi -tag=${1:-"1.1"} +TAG="1.1" +if [[ $(uname -m) == 'arm64' ]]; then + TAG="$TAG.m1" +fi + +tag=${1:-$TAG} docker build -t commapp/services-base:${tag} base-image diff --git a/services/scripts/run_server_image.sh b/services/scripts/run_server_image.sh --- a/services/scripts/run_server_image.sh +++ b/services/scripts/run_server_image.sh @@ -29,5 +29,9 @@ exit 1 fi +if [[ $(uname -m) == 'arm64' ]]; then + export COMM_BASE_IMAGE_M1_SUFFIX=".m1" +fi + docker-compose build $SERVICE-server docker-compose up $SERVICE-server diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile --- a/services/tunnelbroker/Dockerfile +++ b/services/tunnelbroker/Dockerfile @@ -1,4 +1,5 @@ -FROM commapp/services-base:1.1 +ARG COMM_BASE_IMAGE_M1_SUFFIX +FROM commapp/services-base:1.1${COMM_BASE_IMAGE_M1_SUFFIX} ARG MAKE_JOBS=4 ENV MAKEFLAGS="-j${MAKE_JOBS}"