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 +FROM ${COMM_BASE_IMAGE} 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 +FROM ${COMM_BASE_IMAGE} 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=${COMM_BASE_IMAGE} - 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=${COMM_BASE_IMAGE} - 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=${COMM_BASE_IMAGE} - 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,12 @@ exit 1 fi +DOCKERFILE="commapp/services-base:1.1" +if [[ $(uname -m) == 'arm64' ]]; then + DOCKERFILE="commapp/services-base:1.1.m1" +fi + +export COMM_BASE_IMAGE=$DOCKERFILE + 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 +FROM ${COMM_BASE_IMAGE} ARG MAKE_JOBS=4 ENV MAKEFLAGS="-j${MAKE_JOBS}"