From c8be875f5b2010a5ffa8111c3df4a19a732a3b33 Mon Sep 17 00:00:00 2001 From: Marcin Trojanowski Date: Thu, 13 Jan 2022 13:35:00 +0100 Subject: [PATCH 1/2] update controller Dockerfile Signed-off-by: Marcin Trojanowski --- dp/tools/skaffold_hooks/hooks.sh | 1 + orc8r/cloud/docker/controller/Dockerfile | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/dp/tools/skaffold_hooks/hooks.sh b/dp/tools/skaffold_hooks/hooks.sh index b8bf7c4ef2f7..db862240c88b 100755 --- a/dp/tools/skaffold_hooks/hooks.sh +++ b/dp/tools/skaffold_hooks/hooks.sh @@ -3,6 +3,7 @@ export MAGMA_ROOT=$(realpath ..) build_controller() { + export DOCKER_BUILDKIT=1 cd $MAGMA_ROOT/orc8r/cloud/docker python3 build.py -b controller docker tag orc8r_controller: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 From 86810ecb30a6a88eeed38f2414d51c67f3b62b82 Mon Sep 17 00:00:00 2001 From: Marcin Trojanowski Date: Mon, 17 Jan 2022 11:40:18 +0100 Subject: [PATCH 2/2] fix hooks envs Signed-off-by: Marcin Trojanowski --- dp/tools/skaffold_hooks/hooks.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dp/tools/skaffold_hooks/hooks.sh b/dp/tools/skaffold_hooks/hooks.sh index db862240c88b..0dbb4c6343f7 100755 --- a/dp/tools/skaffold_hooks/hooks.sh +++ b/dp/tools/skaffold_hooks/hooks.sh @@ -4,20 +4,21 @@ 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 }