10000 Add multiarch (amd64/arm64) support for Docker images · symfony-cli/symfony-cli@cecd313 · GitHub
[go: up one dir, main page]

Skip to content

Commit cecd313

Browse files
committed
Add multiarch (amd64/arm64) support for Docker images
1 parent 6ac1b44 commit cecd313

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

.github/workflows/releaser.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,23 @@ jobs:
1313
releaser:
1414
name: Release
1515
runs-on: ubuntu-latest
16+
env:
17+
# We need to set DOCKER_CLI_EXPERIMENTAL=enabled for the docker manifest commands to work
18+
DOCKER_CLI_EXPERIMENTAL: "enabled"
1619
steps:
1720
-
1821
name: Checkout
1922
uses: actions/checkout@v2
2023
with:
2124
fetch-depth: 0
2225

23-
- name: Login into Github Docker Registery
26+
# We need QEMU to use buildx and be able to build ARM Docker images
27+
- name: Set up QEMU
28+
uses: docker/setup-qemu-action@v2
29+
30+
- name: Login into Github Docker Registry
2431
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
32+
if: startsWith(github.ref, 'refs/tags/v')
2533

2634
-
2735
name: Set up Go

.goreleaser.yml

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,31 @@ nfpms:
115115
- git
116116

117117
dockers:
118-
- image_templates:
119-
- "ghcr.io/symfony-cli/symfony-cli:{{ .Tag }}"
120-
- "ghcr.io/symfony-cli/symfony-cli:v{{ .Major }}"
121-
- "ghcr.io/symfony-cli/symfony-cli:v{{ .Major }}.{{ .Minor }}"
122-
- "ghcr.io/symfony-cli/symfony-cli:latest"
118+
- image_templates: [ 8000 "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64" ]
119+
goarch: amd64
120+
use: buildx
123121
build_flag_templates:
122+
- "--platform=linux/amd64"
124123
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
124+
- "--label=org.opencontainers.image.created={{.Date}}"
125+
- "--label=org.opencontainers.image.version={{.Version}}"
126+
- image_templates: [ "ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64" ]
127+
goarch: arm64
128+
use: buildx
129+
build_flag_templates:
130+
- "--platform=linux/arm64"
131+
- "--label=org.opencontainers.image.source=https://github.com/symfony-cli/symfony-cli"
132+
- "--label=org.opencontainers.image.created={{.Date}}"
133+
- "--label=org.opencontainers.image.version={{.Version}}"
134+
135+
docker_manifests:
136+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}
137+
image_templates: &docker_images
138+
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-amd64
139+
- ghcr.io/symfony-cli/{{ .ProjectName }}:{{ .Version }}-arm64
140+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}
141+
image_templates: *docker_images
142+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:v{{ .Major }}.{{ .Minor }}
143+
image_templates: *docker_images
144+
- name_template: ghcr.io/symfony-cli/{{ .ProjectName }}:latest
145+
image_templates: *docker_images

0 commit comments

Comments
 (0)
0