diff --git a/Makefile b/Makefile index 5e20832..8a21d6b 100644 --- a/Makefile +++ b/Makefile @@ -1,18 +1,22 @@ # Note: these can be overriden on the command line e.g. `make VERSION=2024.10` VERSION=2024.10 -.PHONY: setup clean base alapenna +.PHONY: base-amd64 base-arm64 base alapenna -setup: - docker run --rm --privileged multiarch/qemu-user-static --reset -p yes - docker buildx create --name multiarch --driver docker-container --use - docker buildx inspect --bootstrap -clean: - docker buildx rm multiarch +base-amd64: + docker build --push --platform=linux/amd64 -t portainer/dev-toolkit:$(VERSION)-amd64 -f Dockerfile . -base: setup - docker buildx build --push --platform=linux/arm64,linux/amd64 -t portainer/dev-toolkit:$(VERSION) -f Dockerfile . +base-arm64: + docker build --push --platform=linux/arm64 -t portainer/dev-toolkit:$(VERSION)-arm64 -f Dockerfile . -alapenna: +# Note: buildx sucks for multi-arch: https://skyworkz.nl/blog/multi-arch-docker-image-10x-faster +base: base-amd64 base-arm64 + docker manifest create \ + portainer/dev-toolkit:$(VERSION) \ + portainer/dev-toolkit:$(VERSION)-amd64 \ + portainer/dev-toolkit:$(VERSION)-arm64 + docker manifest push portainer/dev-toolkit:$(VERSION) + +alapenna: base docker buildx build --no-cache --load -t portainer-dev-toolkit:alapenna -f user-toolkits/alapenna/Dockerfile . diff --git a/hooks/build b/hooks/build index ec43738..77ec980 100644 --- a/hooks/build +++ b/hooks/build @@ -1,7 +1,5 @@ #!/usr/bin/env bash - -docker run --rm --privileged multiarch/qemu-user-static --reset -p yes -docker buildx create --name multiarch --driver docker-container --use -docker buildx inspect --bootstrap - -docker buildx build --push --platform=linux/arm64,linux/amd64 -t "$IMAGE_NAME" -f "$DOCKERFILE_PATH" . +docker build --push --platform=linux/amd64 -t "$IMAGE_NAME-amd64" -f "$DOCKERFILE_PATH" . +docker build --push --platform=linux/arm64 -t "$IMAGE_NAME-arm64" -f "$DOCKERFILE_PATH" . +docker manifest create "$IMAGE_NAME" "$IMAGE_NAME-amd64" "$IMAGE_NAME-arm64" +docker manifest push "$IMAGE_NAME"