Skip to content

Commit 13e38e9

Browse files
committed
fix(release): use Dockerfile.goreleaser with pre-built binary for GoReleaser docker builds
GoReleaser build context only contains the binary — not source files. The multi-stage Dockerfile tried to COPY go.mod/go.sum which don't exist in that context. Dockerfile.goreleaser copies the pre-built binary into an alpine image instead.
1 parent 8352306 commit 13e38e9

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.goreleaser.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,19 +134,20 @@ dockers:
134134
- image_templates:
135135
- "ghcr.io/iamvirul/deepdiff-db:{{ .Version }}-amd64"
136136
use: buildx
137+
dockerfile: Dockerfile.goreleaser
137138
build_flag_templates:
138139
- "--platform=linux/amd64"
139-
- "--build-arg=VERSION={{ .Version }}"
140140
- "--label=org.opencontainers.image.title=deepdiff-db"
141141
- "--label=org.opencontainers.image.version={{ .Version }}"
142142
- "--label=org.opencontainers.image.source=https://github.com/iamvirul/deepdiff-db"
143143
- image_templates:
144144
- "ghcr.io/iamvirul/deepdiff-db:{{ .Version }}-arm64"
145145
use: buildx
146+
dockerfile: Dockerfile.goreleaser
146147
goarch: arm64
147148
build_flag_templates:
148149
- "--platform=linux/arm64"
149-
- "--build-arg=VERSION={{ .Version }}"
150+
- "--label=org.opencontainers.image.version={{ .Version }}"
150151

151152
docker_manifests:
152153
- name_template: "ghcr.io/iamvirul/deepdiff-db:{{ .Version }}"

Dockerfile.goreleaser

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
FROM alpine:3.21
2+
RUN apk add --no-cache ca-certificates tzdata
3+
COPY deepdiffdb /usr/local/bin/deepdiffdb
4+
USER 65534:65534
5+
ENTRYPOINT ["/usr/local/bin/deepdiffdb"]
6+
CMD ["--help"]

0 commit comments

Comments
 (0)