Skip to content

Commit

Permalink
Update dockerfiles to fix chainguard image references
Browse files Browse the repository at this point in the history
  • Loading branch information
tstirrat15 committed Dec 2, 2024
1 parent 8d41932 commit 709d9cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .goreleaser.docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ dockers:
- &amd_debug_image_gh "ghcr.io/authzed/zed:v{{ .Version }}-amd64-debug"
- &amd_debug_image_dh "authzed/zed:v{{ .Version }}-amd64-debug"
ids: ["linux-amd64"]
dockerfile: &dockerfile "Dockerfile.release"
dockerfile: "Dockerfile.release"
goos: "linux"
goarch: "amd64"
use: "buildx"
Expand Down
8 changes: 6 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
FROM golang:1.23-alpine3.20 AS zed-builder
# NOTE: we use the chainguard image here rather
# than the golang image because the golang image
# uses musl as its libc, and chainguard no longer provides
# a musl-dynamic container. - 2024-12-02 Tanner Stirrat
FROM cgr.dev/chainguard/go:latest AS zed-builder
WORKDIR /go/src/app
RUN apk update && apk add --no-cache git
COPY . .
RUN go build -v ./cmd/zed/

FROM cgr.dev/chainguard/musl-dynamic:latest
FROM cgr.dev/chainguard/glibc-dynamic:latest
COPY --from=zed-builder /go/src/app/zed /usr/local/bin/zed
ENTRYPOINT ["zed"]
6 changes: 5 additions & 1 deletion Dockerfile.release
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# vim: syntax=dockerfile
ARG BASE=cgr.dev/chainguard/musl-dynamic:latest
# NOTE: we use chainguard's static image because
# the version of zed that we build for this container
# is statically-linked (i.e. CGO_ENABLED=0) and therefore
# doesn't need a libc.
ARG BASE=cgr.dev/chainguard/static:latest

FROM $BASE

Expand Down

0 comments on commit 709d9cd

Please sign in to comment.