-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use docker build instead of buildx for multi-arch
- Loading branch information
1 parent
45bdec3
commit 52399cb
Showing
2 changed files
with
18 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" |