Skip to content

Commit d5fb6ee

Browse files
authored
fix: build release images with matching target architecture (#3325)
Signed-off-by: Jeff Rescignano <jeffr@defenseunicorns.com>
1 parent d775aed commit d5fb6ee

2 files changed

Lines changed: 16 additions & 3 deletions

File tree

‎.goreleaser.yml‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ builds:
1313
- -X main.Version={{ .Version }}
1414
targets:
1515
- linux_amd64
16+
- linux_arm64
1617
- binary: artifact-cas
1718
id: artifact-cas
1819
main: ./app/artifact-cas/cmd
@@ -22,6 +23,7 @@ builds:
2223
- -X main.Version={{ .Version }}
2324
targets:
2425
- linux_amd64
26+
- linux_arm64
2527
- binary: chainloop
2628
id: cli
2729
main: ./app/cli
@@ -43,18 +45,21 @@ builds:
4345
main: ./app/controlplane/plugins/core/discord-webhook/v1/cmd
4446
targets:
4547
- linux_amd64
48+
- linux_arm64
4649
ldflags: ["{{ .Env.COMMON_LDFLAGS }}"]
4750
- binary: chainloop-plugin-smtp
4851
id: chainloop-plugin-smtp
4952
main: ./app/controlplane/plugins/core/smtp/v1/cmd
5053
targets:
5154
- linux_amd64
55+
- linux_arm64
5256
ldflags: ["{{ .Env.COMMON_LDFLAGS }}"]
5357
- binary: chainloop-plugin-dependency-track
5458
id: chainloop-plugin-dependency-track
5559
main: ./app/controlplane/plugins/core/dependency-track/v1/cmd
5660
targets:
5761
- linux_amd64
62+
- linux_arm64
5863
archives:
5964
- format: binary
6065
id: binaries-cli
@@ -98,6 +103,7 @@ dockers:
98103
- chainloop-plugin-dependency-track
99104
image_templates:
100105
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-amd64"
106+
goarch: amd64
101107
use: buildx
102108
build_flag_templates:
103109
- "--pull"
@@ -111,6 +117,7 @@ dockers:
111117
- chainloop-plugin-dependency-track
112118
image_templates:
113119
- "ghcr.io/chainloop-dev/chainloop/control-plane:{{ .Tag }}-arm64"
120+
goarch: arm64
114121
use: buildx
115122
build_flag_templates:
116123
- "--pull"
@@ -123,6 +130,7 @@ dockers:
123130
- app/controlplane/pkg/data/ent/migrate/migrations
124131
image_templates:
125132
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-amd64"
133+
goarch: amd64
126134
use: buildx
127135
build_flag_templates:
128136
- "--pull"
@@ -133,6 +141,7 @@ dockers:
133141
- app/controlplane/pkg/data/ent/migrate/migrations
134142
image_templates:
135143
- "ghcr.io/chainloop-dev/chainloop/control-plane-migrations:{{ .Tag }}-arm64"
144+
goarch: arm64
136145
use: buildx
137146
build_flag_templates:
138147
- "--pull"
@@ -145,6 +154,7 @@ dockers:
145154
- artifact-cas
146155
image_templates:
147156
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-amd64"
157+
goarch: amd64
148158
use: buildx
149159
build_flag_templates:
150160
- "--pull"
@@ -155,6 +165,7 @@ dockers:
155165
- artifact-cas
156166
image_templates:
157167
- "ghcr.io/chainloop-dev/chainloop/artifact-cas:{{ .Tag }}-arm64"
168+
goarch: arm64
158169
use: buildx
159170
build_flag_templates:
160171
- "--pull"
@@ -167,6 +178,7 @@ dockers:
167178
- cli
168179
image_templates:
169180
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-amd64"
181+
goarch: amd64
170182
use: buildx
171183
build_flag_templates:
172184
- "--pull"
@@ -177,6 +189,7 @@ dockers:
177189
- cli
178190
image_templates:
179191
- "ghcr.io/chainloop-dev/chainloop/cli:{{ .Tag }}-arm64"
192+
goarch: arm64
180193
use: buildx
181194
build_flag_templates:
182195
- "--pull"

‎docs/build-and-packaging.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ All binaries and container images are built via [GoReleaser](https://goreleaser.
1919
| `control-plane` | linux/amd64, linux/arm64 | Main backend service |
2020
| `artifact-cas` | linux/amd64, linux/arm64 | Content-addressable storage proxy |
2121
| `chainloop` (CLI) | darwin/amd64, darwin/arm64, linux/amd64, linux/arm64 | Multi-platform client |
22-
| `chainloop-plugin-discord-webhook` | linux/amd64 | Bundled into control-plane image |
23-
| `chainloop-plugin-smtp` | linux/amd64 | Bundled into control-plane image |
24-
| `chainloop-plugin-dependency-track` | linux/amd64 | Bundled into control-plane image |
22+
| `chainloop-plugin-discord-webhook` | linux/amd64, linux/arm64 | Bundled into control-plane image |
23+
| `chainloop-plugin-smtp` | linux/amd64, linux/arm64 | Bundled into control-plane image |
24+
| `chainloop-plugin-dependency-track` | linux/amd64, linux/arm64 | Bundled into control-plane image |
2525

2626
All binaries are statically compiled (`CGO_ENABLED=0`) and stripped (`-s -w`). Version info is injected via `-ldflags` from the git tag. CLI binaries are published as GitHub Release assets alongside a `checksums.txt`.
2727

0 commit comments

Comments
 (0)