A Go application needs a compiler during the build but not while running. The team wants a small runtime image without build tools. Which image-build approach fits?

Published
  1. Install the compiler in the runtime image and leave all build files there
  2. Use a liveness probe to uninstall build packages on every restart
  3. Put the compiler's name in a Kubernetes Service annotation
  4. A multi-stage build that copies the compiled binary into a minimal runtime stage

Comments — 0