From 5e2bc5f8724642ff5335bb4c0b93a471ecb26162 Mon Sep 17 00:00:00 2001 From: ducoterra Date: Tue, 2 Nov 2021 10:19:21 -0400 Subject: [PATCH 1/3] Switch to container-builder buildx platform Continue using buildx with a new container builder name "container-builder". --- make/docker.makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/make/docker.makefile b/make/docker.makefile index fc07142..dc77c21 100644 --- a/make/docker.makefile +++ b/make/docker.makefile @@ -5,16 +5,16 @@ docker-init: .PHONY: buildx-context buildx-context: - docker buildx create --name arm64 --use --platform linux/amd64,linux/arm64 + docker buildx create --name container-builder --use --platform linux/amd64,linux/arm64 .PHONY: buildx-clear buildx-clear: - docker buildx rm arm64 + docker buildx rm container-builder .PHONY: build build: docker buildx build --load . -t $(IMAGE) - @docker buildx build --load . -t $(IMAGE_LATEST) + @docker buildx build --load . -t $(IMAGE_LATEST) .PHONY: push push: From 40a217b585f0ea9727ae7e3df3f9b0f7f1f6d5ea Mon Sep 17 00:00:00 2001 From: ducoterra Date: Tue, 2 Nov 2021 10:22:48 -0400 Subject: [PATCH 2/3] Use buildx to create multi-arch images clear and set the buildx context on push. Then use --push with buildx build to push the multi-arch images immediately after creating them. This gets around the need to store them locally (which won't work for something like an M1 mac). --- make/docker.makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/make/docker.makefile b/make/docker.makefile index dc77c21..2c40944 100644 --- a/make/docker.makefile +++ b/make/docker.makefile @@ -18,5 +18,7 @@ build: .PHONY: push push: - docker buildx build --platform linux/amd64 --push . -t $(IMAGE) - @docker buildx build --platform linux/amd64 --push . -t $(IMAGE_LATEST) + -make buildx-clear + @make buildx-context + docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE) + @docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE_LATEST) From 3563c5c2aa0100574f505b7dda324b5a52ea34cf Mon Sep 17 00:00:00 2001 From: ducoterra Date: Tue, 2 Nov 2021 10:23:53 -0400 Subject: [PATCH 3/3] Add make docker-release Add docker-release command which updates the image tag in the docker-compose.yaml and runs a `make push`. --- make/docker.makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/make/docker.makefile b/make/docker.makefile index 2c40944..23e4a52 100644 --- a/make/docker.makefile +++ b/make/docker.makefile @@ -22,3 +22,8 @@ push: @make buildx-context docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE) @docker buildx build --platform linux/amd64,linux/arm64 --push . -t $(IMAGE_LATEST) + +.PHONY: docker-release +docker-release: + @yq e ".services.minecraft.image = \"$(IMAGE)\"" -i docker-compose.yaml + @make push