Skip to content

Commit c9228ed

Browse files
committed
fix: configure Docker buildx for multi-arch images
- Add Docker QEMU setup for cross-platform builds - Add Docker buildx setup - Add GitHub Container Registry login - Keep multi-arch Docker image configuration
1 parent da15e8b commit c9228ed

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

.github/workflows/release.yaml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,19 @@ jobs:
3636
with:
3737
go-version: '1.24'
3838

39+
- name: Set up QEMU
40+
uses: docker/setup-qemu-action@v3
41+
42+
- name: Set up Docker Buildx
43+
uses: docker/setup-buildx-action@v3
44+
45+
- name: Log in to GitHub Container Registry
46+
uses: docker/login-action@v3
47+
with:
48+
registry: ghcr.io
49+
username: ${{ github.actor }}
50+
password: ${{ secrets.GITHUB_TOKEN }}
51+
3952
- name: Install Syft
4053
uses: anchore/sbom-action/[email protected]
4154

.goreleaser.yaml

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -277,12 +277,32 @@ brews:
277277
278278
# Docker image configuration
279279
dockers:
280-
- id: tokenizer
280+
- id: tokenizer-amd64
281+
ids:
282+
- tokenizer
283+
goos: linux
284+
goarch: amd64
285+
image_templates:
286+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
287+
dockerfile: Dockerfile
288+
use: buildx
289+
build_flag_templates:
290+
- "--pull"
291+
- "--label=org.opencontainers.image.created={{.Date}}"
292+
- "--label=org.opencontainers.image.title={{.ProjectName}}"
293+
- "--label=org.opencontainers.image.revision={{.FullCommit}}"
294+
- "--label=org.opencontainers.image.version={{.Version}}"
295+
- "--label=org.opencontainers.image.source=https://github.com/agentstation/tokenizer"
296+
- "--label=org.opencontainers.image.description=High-performance tokenizer implementations in Go with unified CLI"
297+
- "--label=org.opencontainers.image.licenses=MIT"
298+
- "--platform=linux/amd64"
299+
- id: tokenizer-arm64
281300
ids:
282301
- tokenizer
302+
goos: linux
303+
goarch: arm64
283304
image_templates:
284-
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}"
285-
- "ghcr.io/agentstation/tokenizer:latest"
305+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"
286306
dockerfile: Dockerfile
287307
use: buildx
288308
build_flag_templates:
@@ -294,4 +314,15 @@ dockers:
294314
- "--label=org.opencontainers.image.source=https://github.com/agentstation/tokenizer"
295315
- "--label=org.opencontainers.image.description=High-performance tokenizer implementations in Go with unified CLI"
296316
- "--label=org.opencontainers.image.licenses=MIT"
297-
- "--platform=linux/amd64,linux/arm64"
317+
- "--platform=linux/arm64"
318+
319+
# Docker manifest for multi-arch support
320+
docker_manifests:
321+
- name_template: "ghcr.io/agentstation/tokenizer:{{ .Tag }}"
322+
image_templates:
323+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
324+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"
325+
- name_template: "ghcr.io/agentstation/tokenizer:latest"
326+
image_templates:
327+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-amd64"
328+
- "ghcr.io/agentstation/tokenizer:{{ .Tag }}-arm64"

0 commit comments

Comments
 (0)