diff --git a/dp/tools/skaffold_hooks/hooks.sh b/dp/tools/skaffold_hooks/hooks.sh index b8bf7c4ef2f7..0dbb4c6343f7 100755 --- a/dp/tools/skaffold_hooks/hooks.sh +++ b/dp/tools/skaffold_hooks/hooks.sh @@ -3,20 +3,22 @@ export MAGMA_ROOT=$(realpath ..) build_controller() { + export DOCKER_BUILDKIT=1 + export COMPOSE_DOCKER_CLI_BUILD=1 cd $MAGMA_ROOT/orc8r/cloud/docker - python3 build.py -b controller + python3 build.py -b controller && docker tag orc8r_controller:latest $IMAGE } build_nginx() { cd $MAGMA_ROOT/orc8r/cloud/docker - python3 build.py -b nginx + python3 build.py -b nginx && docker tag orc8r_nginx:latest $IMAGE } build_magmalte() { cd $MAGMA_ROOT/nms/packages/magmalte - docker-compose build magmalte + docker-compose build magmalte && docker tag magmalte_magmalte:latest $IMAGE } diff --git a/orc8r/cloud/docker/controller/Dockerfile b/orc8r/cloud/docker/controller/Dockerfile index e7ba0c559579..a0486ad29cec 100644 --- a/orc8r/cloud/docker/controller/Dockerfile +++ b/orc8r/cloud/docker/controller/Dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1.3 # ------------------------------------------------------------------------------ # Base: for tests, precommit, codegen, etc. # ------------------------------------------------------------------------------ @@ -74,7 +75,8 @@ COPY configs /etc/magma/configs # ------------------------------------------------------------------------------ FROM src as builder -RUN . /etc/profile.d/env.sh && make build +RUN --mount=type=cache,target=/root/.cache/go-build \ +. /etc/profile.d/env.sh && make build # ------------------------------------------------------------------------------ # Production