Go Dockerfiles

Pick the variant that matches your stack. Each one is a complete, copy-paste Dockerfile with a .dockerignore.

VariantBuild imageRuntime imageImage size
Alpine runtime (shell available)golang:1.25-alpinealpine:3.2214.8 MB
Distroless static (nonroot)golang:1.25-alpinegcr.io/distroless/static-debian12:nonroot7.7 MB
Scratch (static, nonroot UID)golang:1.25-alpinescratch6.2 MB