How do you reduce Docker image size?

Use a small base (alpine, distroless, -slim), multi-stage builds that copy only the artefacts, combine RUN steps and clean package caches, and add a .dockerignore.

dockerfile FROM golang:1.22 AS build RUN go build -o /app . FROM gcr.io/distroless/base COPY --from=build /app /app