Skip to content

Commit

Permalink
Cleaner multi-arch build
Browse files Browse the repository at this point in the history
Create the multi-arch manifest in separate steps:
1. Build the specific tagged arch images
2. Create the manifest
3. Add the tagged image to the manifest

This makes the output much easier to manage. The time to create seems
similar to the one command build.

Example output:

    % podman image ls | grep gather
    quay.io/nirsof/gather     0.5.1-16-g928edb2-arm64  7299e9024f63  About a minute ago  110 MB
    quay.io/nirsof/gather     0.5.1-16-g928edb2        53bbc49a60ad  About a minute ago  1.06 kB
    quay.io/nirsof/gather     0.5.1-16-g928edb2-amd64  50d554dccdd8  2 minutes ago       110 MB
  • Loading branch information
nirs committed Sep 4, 2024
1 parent 6fa5931 commit 9dfc820
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,15 @@ ldflags := -s -w \

all: kubectl-gather

container:
container: container-amd64 container-arm64
podman manifest create --amend $(image)
podman manifest add $(image) $(image)-amd64
podman manifest add $(image) $(image)-arm64

container-%:
podman build \
--platform=linux/amd64,linux/arm64 \
--manifest $(image) \
--platform=linux/$* \
--tag $(image)-$* \
--build-arg ldflags="$(ldflags)" \
.

Expand Down

0 comments on commit 9dfc820

Please sign in to comment.