Skip to content

Commit

Permalink
make multi-arch (amd64+arm64) docker images available
Browse files Browse the repository at this point in the history
  • Loading branch information
joemiller committed Dec 8, 2024
1 parent 675cb73 commit 65fabe9
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 10 deletions.
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 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

0 comments on commit 65fabe9

Please sign in to comment.