fix(agent): include root CA certificates in base image (#2291)

This commit is contained in:
henrygd
2026-09-03 14:32:59 -04:00
parent e1d9ebc61d
commit c157c2026d
+4 -1
View File
@@ -8,6 +8,8 @@ RUN go mod download
# Copy source files
COPY . ./
RUN apk add --no-cache ca-certificates && update-ca-certificates
# Build
ARG TARGETOS TARGETARCH
RUN CGO_ENABLED=0 GOGC=75 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -ldflags "-w -s" -o /agent ./internal/cmd/agent
@@ -19,6 +21,7 @@ RUN rm -rf /tmp/*
# --------------------------
FROM scratch
COPY --from=builder /agent /agent
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
# this is so we don't need to create the /tmp directory in the scratch container
COPY --from=builder /tmp /tmp
@@ -29,4 +32,4 @@ COPY --from=builder /app/agent/test-data/amdgpu.ids /usr/share/libdrm/amdgpu.ids
# Ensure data persistence across container recreations
VOLUME ["/var/lib/beszel-agent"]
ENTRYPOINT ["/agent"]
ENTRYPOINT ["/agent"]