Skip to content

Commit

Permalink
Specify builder for docker build (#5002)
Browse files Browse the repository at this point in the history
* Specify builder for docker build

Signed-off-by: Kevin Su <[email protected]>

* nit

Signed-off-by: Kevin Su <[email protected]>

---------

Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw authored Mar 5, 2024
1 parent 4270c53 commit 2adaf61
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions docker/sandbox-bundled/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@ 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 \
../..

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
Expand All @@ -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 .

Expand Down

0 comments on commit 2adaf61

Please sign in to comment.