Go Dockerfiles
Pick the variant that matches your stack. Each one is a complete, copy-paste Dockerfile with a .dockerignore.
| Variant | Build image | Runtime image | Image size |
|---|---|---|---|
| Alpine runtime (shell available) | golang:1.25-alpine | alpine:3.22 | 14.8 MB |
| Distroless static (nonroot) | golang:1.25-alpine | gcr.io/distroless/static-debian12:nonroot | 7.7 MB |
| Scratch (static, nonroot UID) | golang:1.25-alpine | scratch | 6.2 MB |