mirror of
https://github.com/bensuperpc/dockcross.git
synced 2026-07-26 04:48:08 +02:00
Merge pull request #911 from thewtex/buildah-manifest-tool
ci: push multi-arch images with manifest-tool
This commit is contained in:
@@ -1547,6 +1547,13 @@ jobs:
|
|||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
|
- name: Install manifest-tool
|
||||||
|
if: github.ref == 'refs/heads/master'
|
||||||
|
run: |
|
||||||
|
wget https://github.com/estesp/manifest-tool/releases/latest/download/binaries-manifest-tool.tar.gz -O - | tar -xz
|
||||||
|
sudo cp manifest-tool-linux-amd64 /usr/local/bin/manifest-tool
|
||||||
|
sudo chmod +x /usr/local/bin/manifest-tool
|
||||||
|
|
||||||
- name: deploy-multi-arch
|
- name: deploy-multi-arch
|
||||||
if: github.ref == 'refs/heads/master'
|
if: github.ref == 'refs/heads/master'
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
# Common values: docker, podman, buildah
|
# Common values: docker, podman, buildah
|
||||||
DOCKER := $(or $(OCI_EXE), docker)
|
DOCKER := $(or $(OCI_EXE), docker)
|
||||||
BUILD_DOCKER := $(or $(BUILD_DOCKER), $(DOCKER))
|
BUILD_DOCKER := $(or $(BUILD_DOCKER), $(DOCKER))
|
||||||
BUILDAH := $(or $(BUILDAH_EXE), buildah)
|
MANIFEST_TOOL := $(or $(MANIFEST_TOOL_EXE), manifest-tool)
|
||||||
RM = --rm
|
RM = --rm
|
||||||
|
|
||||||
# Name of the docker-equivalent executable for running test containers.
|
# Name of the docker-equivalent executable for running test containers.
|
||||||
@@ -382,16 +382,17 @@ $(addsuffix .push,$(STANDARD_IMAGES) $(NON_STANDARD_IMAGES)): $$(basename $$@)
|
|||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
$(addsuffix .manifest,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
|
$(addsuffix .manifest,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@)
|
||||||
if $(BUILDAH) manifest exists $(ORG)/$(basename $@); then \
|
$(MANIFEST_TOOL) push from-args \
|
||||||
$(BUILDAH) manifest rm $(ORG)/$(basename $@); fi
|
--platforms linux/amd64,linux/arm64 \
|
||||||
$(BUILDAH) manifest create $(ORG)/$(basename $@)
|
--template $(ORG)/$(basename $@):latest-ARCH \
|
||||||
$(BUILDAH) manifest add $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest-amd64
|
--target $(ORG)/$(basename $@):latest
|
||||||
$(BUILDAH) manifest add $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest-arm64
|
|
||||||
|
|
||||||
.SECONDEXPANSION:
|
.SECONDEXPANSION:
|
||||||
$(addsuffix .push,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@).manifest
|
$(addsuffix .push,$(MULTIARCH_IMAGES) web-wasi-threads web-wasm): $$(basename $$@).manifest
|
||||||
$(BUILDAH) manifest push --all --format v2s2 $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):latest
|
$(MANIFEST_TOOL) push from-args \
|
||||||
$(BUILDAH) manifest push --all --format v2s2 $(ORG)/$(basename $@) docker://$(ORG)/$(basename $@):$(TAG)
|
--platforms linux/amd64,linux/arm64 \
|
||||||
|
--template $(ORG)/$(basename $@):$(TAG)-ARCH \
|
||||||
|
--target $(ORG)/$(basename $@):$(TAG)
|
||||||
|
|
||||||
#
|
#
|
||||||
# testing prerequisites implicit rule
|
# testing prerequisites implicit rule
|
||||||
|
|||||||
@@ -620,6 +620,14 @@ Note that the architecture is now `aarch64` instead of `amd64`, so it runs nativ
|
|||||||
|
|
||||||
\-\--
|
\-\--
|
||||||
|
|
||||||
|
## Multi-architecture Image Creation
|
||||||
|
|
||||||
|
For creating multi-architecture container images, this project uses [manifest-tool](https://github.com/estesp/manifest-tool) to create and manage manifest lists that combine platform-specific images into a single multi-platform reference. This allows container runtimes to automatically select the appropriate image based on the target architecture.
|
||||||
|
|
||||||
|
The multi-architecture images are built on different architectures (amd64 and arm64) and then combined using manifest-tool's `push from-args` command, which creates manifest lists pointing to the individual platform-specific images.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
Credits:
|
Credits:
|
||||||
|
|
||||||
- [sdt/docker-raspberry-pi-cross-compiler](https://github.com/sdt/docker-raspberry-pi-cross-compiler), who invented the base of the **dockcross** script.
|
- [sdt/docker-raspberry-pi-cross-compiler](https://github.com/sdt/docker-raspberry-pi-cross-compiler), who invented the base of the **dockcross** script.
|
||||||
|
|||||||
Reference in New Issue
Block a user