diff --git a/docs/dev_services.md b/docs/dev_services.md --- a/docs/dev_services.md +++ b/docs/dev_services.md @@ -88,14 +88,18 @@ yarn run-[service-name]-service-in-sandbox ``` -For example, for Tunnelbroker the command will look like this: +For example, for Tunnelbroker the command will look like this: ``` yarn run-tunnelbroker-service-in-sandbox ``` -You can also run all services at once in the sandbox using the command below: +You can also run all services at once in the sandbox using the command below: ``` yarn run-all-services-in-sandbox ``` + +### Rebuilding the base image + +If you ever wish to rebuild the base image, you should get a tool named [buildx](https://github.com/docker/buildx). It should be attached with the docker desktop app on the Mac OS, but if you use Linux, you will probably need to install it manually. For the installation instructions, please go [here](https://github.com/docker/buildx#installing). diff --git a/services/backup/Dockerfile b/services/backup/Dockerfile --- a/services/backup/Dockerfile +++ b/services/backup/Dockerfile @@ -1,4 +1,4 @@ -FROM commapp/services-base:1.1 +FROM commapp/services-base:1.2 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,4 @@ -FROM commapp/services-base:1.1 +FROM commapp/services-base:1.2 RUN apt-get update && \ apt-get install -y uuid-dev && \ 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,24 @@ exit 1 fi -tag=${1:-"1.1"} -docker build -t commapp/services-base:"${tag}" base-image + +tag=${1:-"1.2"} + +BUILDER_NAME="COMM_BUILDER" + +BUILDER_PRESENT=$(docker buildx inspect "$BUILDER_NAME" 2> /dev/null || echo "") + +if [[ -z "${BUILDER_PRESENT}" ]]; then + echo "builder not found, creating builder $BUILDER_NAME"; + docker buildx create --name "$BUILDER_NAME" +fi; + +docker buildx use "$BUILDER_NAME" + +# use --push to automatically push this image to the hub +docker buildx build \ + --tag commapp/services-base:"${tag}" \ + -o type=image \ + --platform=linux/arm64,linux/amd64 \ + # --push \ + base-image/. diff --git a/services/tunnelbroker/Dockerfile b/services/tunnelbroker/Dockerfile --- a/services/tunnelbroker/Dockerfile +++ b/services/tunnelbroker/Dockerfile @@ -1,4 +1,4 @@ -FROM commapp/services-base:1.1 +FROM commapp/services-base:1.2 ARG MAKE_JOBS=4 ENV MAKEFLAGS="-j${MAKE_JOBS}"