From a4659d90a9495bdc62ba36adfc0ceaff6c2d2804 Mon Sep 17 00:00:00 2001 From: Pijus Kamandulis Date: Sun, 8 Dec 2024 18:55:20 +0200 Subject: [PATCH] Enable multi-platform docker builds --- .goreleaser.yaml | 43 +++++++++++++++++++++++++++++++++++++++---- 1 file changed, 39 insertions(+), 4 deletions(-) diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 6673f3a..49a2e0f 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -27,11 +27,14 @@ brews: email: git@pikami.org dockers: - - image_templates: - - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}" - - "ghcr.io/pikami/{{ .ProjectName }}:latest" + - id: docker-linux-amd64 + goos: linux + goarch: amd64 + image_templates: + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-amd64" + - "ghcr.io/pikami/{{ .ProjectName }}:latest-amd64" dockerfile: Dockerfile - use: docker + use: buildx build_flag_templates: - "--platform=linux/amd64" - "--pull" @@ -42,6 +45,38 @@ dockers: - "--label=org.opencontainers.image.created={{.Date}}" - "--label=org.opencontainers.image.revision={{.FullCommit}}" - "--label=org.opencontainers.image.version={{.Version}}" + - id: docker-linux-arm64 + goos: linux + goarch: arm64 + image_templates: + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-arm64" + - "ghcr.io/pikami/{{ .ProjectName }}:latest-arm64" + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-arm64v8" + - "ghcr.io/pikami/{{ .ProjectName }}:latest-arm64v8" + dockerfile: Dockerfile + use: buildx + build_flag_templates: + - "--platform=linux/arm64" + - "--pull" + - "--label=org.opencontainers.image.title={{.ProjectName}}" + - "--label=org.opencontainers.image.description=Lightweight Cosmos DB emulator" + - "--label=org.opencontainers.image.url=https://github.com/pikami/cosmium" + - "--label=org.opencontainers.image.source=https://github.com/pikami/cosmium" + - "--label=org.opencontainers.image.created={{.Date}}" + - "--label=org.opencontainers.image.revision={{.FullCommit}}" + - "--label=org.opencontainers.image.version={{.Version}}" + +docker_manifests: + - name_template: 'ghcr.io/pikami/{{ .ProjectName }}:latest' + image_templates: + - "ghcr.io/pikami/{{ .ProjectName }}:latest-amd64" + - "ghcr.io/pikami/{{ .ProjectName }}:latest-arm64" + - "ghcr.io/pikami/{{ .ProjectName }}:latest-arm64v8" + - name_template: 'ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}' + image_templates: + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-amd64" + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-arm64" + - "ghcr.io/pikami/{{ .ProjectName }}:{{ .Version }}-arm64v8" checksum: name_template: 'checksums.txt'