Skip to content

Commit

Permalink
multi-platform docker images
Browse files Browse the repository at this point in the history
  • Loading branch information
everesio committed Feb 26, 2024
1 parent 8bb71cb commit b9fc79f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: docker/setup-qemu-action@v3
- uses: goreleaser/goreleaser-action@v5 # run goreleaser
with:
version: latest
Expand Down
29 changes: 27 additions & 2 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,18 +62,43 @@ signs:

# create a docker image
# https://goreleaser.com/customization/docker
# https://goreleaser.com/cookbooks/multi-platform-docker-images/
dockers:
- image_templates:
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}"
- "ghcr.io/grepplabs/reverse-http:latest"
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/amd64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"
- image_templates:
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64"
dockerfile: Dockerfile
use: buildx
build_flag_templates:
- "--pull"
- "--platform=linux/arm64"
- "--label=org.opencontainers.image.created={{.Date}}"
- "--label=org.opencontainers.image.name={{.ProjectName}}"
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
- "--label=org.opencontainers.image.version={{.Version}}"
- "--label=org.opencontainers.image.source={{.GitURL}}"

# https://goreleaser.com/customization/docker_manifest/
docker_manifests:
- name_template: 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}'
image_templates:
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64'
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64'
- name_template: 'ghcr.io/grepplabs/reverse-http:latest'
image_templates:
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64'
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64'

# signs our docker image
# https://goreleaser.com/customization/docker_sign
Expand Down

0 comments on commit b9fc79f

Please sign in to comment.