Skip to content

Commit b9fc79f

Browse files
committed
multi-platform docker images
1 parent 8bb71cb commit b9fc79f

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ jobs:
3333
registry: ghcr.io
3434
username: ${{ github.repository_owner }}
3535
password: ${{ secrets.GITHUB_TOKEN }}
36+
- uses: docker/setup-qemu-action@v3
3637
- uses: goreleaser/goreleaser-action@v5 # run goreleaser
3738
with:
3839
version: latest

.goreleaser.yaml

+27-2
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,43 @@ signs:
6262

6363
# create a docker image
6464
# https://goreleaser.com/customization/docker
65+
# https://goreleaser.com/cookbooks/multi-platform-docker-images/
6566
dockers:
6667
- image_templates:
67-
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}"
68-
- "ghcr.io/grepplabs/reverse-http:latest"
68+
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64"
6969
dockerfile: Dockerfile
70+
use: buildx
7071
build_flag_templates:
7172
- "--pull"
73+
- "--platform=linux/amd64"
7274
- "--label=org.opencontainers.image.created={{.Date}}"
7375
- "--label=org.opencontainers.image.name={{.ProjectName}}"
7476
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
7577
- "--label=org.opencontainers.image.version={{.Version}}"
7678
- "--label=org.opencontainers.image.source={{.GitURL}}"
79+
- image_templates:
80+
- "ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64"
81+
dockerfile: Dockerfile
82+
use: buildx
83+
build_flag_templates:
84+
- "--pull"
85+
- "--platform=linux/arm64"
86+
- "--label=org.opencontainers.image.created={{.Date}}"
87+
- "--label=org.opencontainers.image.name={{.ProjectName}}"
88+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
89+
- "--label=org.opencontainers.image.version={{.Version}}"
90+
- "--label=org.opencontainers.image.source={{.GitURL}}"
91+
92+
# https://goreleaser.com/customization/docker_manifest/
93+
docker_manifests:
94+
- name_template: 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}'
95+
image_templates:
96+
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64'
97+
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64'
98+
- name_template: 'ghcr.io/grepplabs/reverse-http:latest'
99+
image_templates:
100+
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-amd64'
101+
- 'ghcr.io/grepplabs/reverse-http:{{ .Tag }}-arm64'
77102

78103
# signs our docker image
79104
# https://goreleaser.com/customization/docker_sign

0 commit comments

Comments
 (0)