From 2adaf612348c9b3d83f4640b0eedba6e2ab33f4c Mon Sep 17 00:00:00 2001 From: Kevin Su Date: Tue, 5 Mar 2024 02:19:09 -0800 Subject: [PATCH] Specify builder for docker build (#5002) * Specify builder for docker build Signed-off-by: Kevin Su * nit Signed-off-by: Kevin Su --------- Signed-off-by: Kevin Su --- docker/sandbox-bundled/Makefile | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docker/sandbox-bundled/Makefile b/docker/sandbox-bundled/Makefile index d2ec89de8b..1c080db16a 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 @@ -39,11 +48,6 @@ manifests: dep_update .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 docker buildx build --builder flyte-sandbox --allow security.insecure --load \ --tag flyte-sandbox:latest .