Skip to content

Commit

Permalink
feat(docker): implement multi-arch manifest creation for improved dis…
Browse files Browse the repository at this point in the history
…tribution
  • Loading branch information
yarlson committed Jan 25, 2025
1 parent 3d80522 commit 69404c4
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ dockers:
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/amd64"
- "--load"

- image_templates:
- "yarlson/zero:{{ .Version }}-arm64v8"
Expand All @@ -40,6 +41,18 @@ dockers:
dockerfile: Dockerfile
build_flag_templates:
- "--platform=linux/arm64/v8"
- "--load"

docker_manifests:
- name_template: "yarlson/zero:{{ .Version }}"
image_templates:
- "yarlson/zero:{{ .Version }}-amd64"
- "yarlson/zero:{{ .Version }}-arm64v8"

- name_template: "yarlson/zero:latest"
image_templates:
- "yarlson/zero:latest-amd64"
- "yarlson/zero:latest-arm64v8"

release:
github:
Expand Down
18 changes: 18 additions & 0 deletions create-manifests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash
VERSION="0.3.7"

# Create and push version manifest
docker manifest create yarlson/zero:${VERSION} \
--amend yarlson/zero:${VERSION}-amd64 \
yarlson/zero:${VERSION}-amd64 \
yarlson/zero:${VERSION}-arm64v8

docker manifest push yarlson/zero:${VERSION}

# Create and push latest manifest
docker manifest create yarlson/zero:latest \
--amend yarlson/zero:latest-amd64 \
yarlson/zero:latest-amd64 \
yarlson/zero:latest-arm64v8

docker manifest push yarlson/zero:latest

0 comments on commit 69404c4

Please sign in to comment.