From 83927c5a1b70b43f795cb4784284230f21017114 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Tue, 5 Mar 2024 01:22:58 -0800 Subject: [PATCH 1/2] Specify builder for docker build Signed-off-by: Kevin Su --- docker/sandbox-bundled/Makefile | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/docker/sandbox-bundled/Makefile b/docker/sandbox-bundled/Makefile index d2ec89de8b..bf901742cc 100644 --- a/docker/sandbox-bundled/Makefile +++ b/docker/sandbox-bundled/Makefile @@ -3,6 +3,7 @@ mkdir -p images/tar/$(1) docker buildx build \ --build-arg FLYTECONSOLE_VERSION=$(FLYTECONSOLE_VERSION) \ + --builder flyte-sandbox \ --platform linux/$(1) \ --tag flyte-binary:sandbox \ --output type=docker,dest=images/tar/$(1)/flyte-binary.tar \ @@ -10,9 +11,17 @@ docker buildx build \ endef +.PHONY: create_builder +create_builder: + [ -n "$(shell docker buildx ls | awk '/^flyte-sandbox / {print $$1}')" ] || \ + docker buildx create --name flyte-sandbox \ + --driver docker-container --driver-opt image=moby/buildkit:master \ + --buildkitd-flags '--allow-insecure-entitlement security.insecure' \ + --platform linux/arm64,linux/amd64 + .PHONY: flyte flyte: FLYTECONSOLE_VERSION := latest -flyte: +flyte: create_builder $(foreach arch,amd64 arm64,$(call FLYTE_BINARY_BUILD,$(arch))) .PHONY: dep_update @@ -38,12 +47,7 @@ manifests: dep_update kustomize/complete-agent > manifests/complete-agent.yaml .PHONY: build -build: flyte dep_update manifests - [ -n "$(shell docker buildx ls | awk '/^flyte-sandbox / {print $$1}')" ] || \ - docker buildx create --name flyte-sandbox \ - --driver docker-container --driver-opt image=moby/buildkit:master \ - --buildkitd-flags '--allow-insecure-entitlement security.insecure' \ - --platform linux/arm64,linux/amd64 +build: create_builder flyte dep_update manifests docker buildx build --builder flyte-sandbox --allow security.insecure --load \ --tag flyte-sandbox:latest . From 376034dc56541815750d4bf38439a853186e1307 Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Tue, 5 Mar 2024 01:57:25 -0800 Subject: [PATCH 2/2] nit Signed-off-by: Kevin Su --- docker/sandbox-bundled/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/sandbox-bundled/Makefile b/docker/sandbox-bundled/Makefile index bf901742cc..1c080db16a 100644 --- a/docker/sandbox-bundled/Makefile +++ b/docker/sandbox-bundled/Makefile @@ -47,7 +47,7 @@ manifests: dep_update kustomize/complete-agent > manifests/complete-agent.yaml .PHONY: build -build: create_builder flyte dep_update manifests +build: flyte dep_update manifests docker buildx build --builder flyte-sandbox --allow security.insecure --load \ --tag flyte-sandbox:latest .