Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make multi-arch (amd64+arm64) docker images available #130

Merged
merged 1 commit into from
Dec 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 41 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,11 +108,47 @@ archives:
- goos: windows
format: zip

# TODO(joem): multi-arch docker image: https://goreleaser.com/cookbooks/multi-platform-docker-images/
dockers:
- dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}" # v1.0.0
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}" # v1
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}" # v1.0
- "ghcr.io/autotag-dev/autotag:latest"
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64" # v1.0.0-amd64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-amd64" # v1-amd64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64" # v1.0-amd64
- "ghcr.io/autotag-dev/autotag:latest-amd64"

- dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64" # v1.0.0-arm64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}-arm64" # v1-arm64
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64" # v1.0-arm64
- "ghcr.io/autotag-dev/autotag:latest-arm64"

# use `docker_manifests` section to create combined multi-arch image manifests:
docker_manifests:
- name_template: "ghcr.io/autotag-dev/autotag:{{ .Tag }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-amd64"
- "ghcr.io/autotag-dev/autotag:{{ .Tag }}-arm64"

- name_template: "ghcr.io/autotag-dev/autotag:{{ .Major }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:{{ .Major }}-amd64"
- "ghcr.io/autotag-dev/autotag:{{ .Major }}-arm64"

- name_template: "ghcr.io/autotag-dev/autotag:{{ .Major }}.{{ .Minor }}"
image_templates:
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-amd64"
- "ghcr.io/autotag-dev/autotag:v{{ .Major }}.{{ .Minor }}-arm64"

- name_template: "ghcr.io/autotag-dev/autotag:latest"
image_templates:
- "ghcr.io/autotag-dev/autotag:latest-amd64"
- "ghcr.io/autotag-dev/autotag:latest-arm64"
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ cov:
go tool cover -func cover.out

snapshot:
@goreleaser --rm-dist --snapshot --debug
@goreleaser release --clean --snapshot --verbose
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ Installing
### Pre-built binaries

| OS | Arch | binary |
| ----- | ----- | ------------------- |
|-------|-------|---------------------|
| macOS | amd64 | [autotag][releases] |
| Linux | amd64 | [autotag][releases] |

### Docker images

| Arch | Images |
| ----- | ---------------------------------------------------------------- |
| amd64 | `ghcr.io/autotag-dev/autotag:latest`, `vX.Y.Z`, `vX.Y`, `vX` |
> multi-arch and -arm64 images are available beginning with v1.3.34

| Arch | Images |
|------------|--------------------------------------------------------------------------------------|
| multi-arch | `ghcr.io/autotag-dev/autotag:latest`, `vX.Y.Z`, `vX.Y`, `vX` |
| amd64 | `ghcr.io/autotag-dev/autotag:latest-amd64`, `vX.Y.Z-amd64`, `vX.Y-amd64`, `vX-amd64` |
| arm64 | `ghcr.io/autotag-dev/autotag:latest-arm64`, `vX.Y.Z-arm64`, `vX.Y-arm64`, `vX-arm64` |

[releases]: https://github.com/autotag-dev/autotag/releases/latest

Expand Down
Loading