From 709d9cd57c740ba81a01e98f5c4c76665ff726fc Mon Sep 17 00:00:00 2001 From: Tanner Stirrat Date: Mon, 2 Dec 2024 12:38:25 -0700 Subject: [PATCH] Update dockerfiles to fix chainguard image references --- .goreleaser.docker.yml | 2 +- Dockerfile | 8 ++++++-- Dockerfile.release | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.goreleaser.docker.yml b/.goreleaser.docker.yml index fe96d9ed..d1b59e10 100644 --- a/.goreleaser.docker.yml +++ b/.goreleaser.docker.yml @@ -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" diff --git a/Dockerfile b/Dockerfile index 4e693d95..b328f724 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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"] diff --git a/Dockerfile.release b/Dockerfile.release index 5d5eac96..021db9b8 100644 --- a/Dockerfile.release +++ b/Dockerfile.release @@ -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