Skip to content

Instantly share code, notes, and snippets.

View bdw617's full-sized avatar

Barry Waldbaum bdw617

  • Boston
View GitHub Profile
@michaelboke
michaelboke / Dockerfile
Last active June 26, 2024 14:46
Docker scratch x509 fix
FROM golang:alpine as builder
WORKDIR /app
RUN apk update && apk upgrade && apk add --no-cache ca-certificates
RUN update-ca-certificates
ADD main.go /app/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -ldflags="-s -w" -installsuffix cgo -o app .
FROM scratch
COPY --from=builder /app/app .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/