How should I build my images for both arm64 and amd64 so I can move onto Graviton?
Bundle both architectures under one buildx tag, cross-compile Go with TARGETARCH, and use native arm64 runners when extension builds drag under QEMU.
Tag
Containerization with Docker: image layers, multi-stage builds and portable environments. Questions under this tag, answered directly.
8 answered questions carry this tag.
Bundle both architectures under one buildx tag, cross-compile Go with TARGETARCH, and use native arm64 runners when extension builds drag under QEMU.
Measure the working set instead of raising the limit; compute max_children against the cap in PHP-FPM and set GOMEMLIMIT plus GOMAXPROCS in Go.
Flip CMD to exec form and listen with signal.NotifyContext(..., syscall.SIGTERM) instead of os.Interrupt; add tini only if the worker forks.
Pin the user with a build-time ARG UID, use COPY --chown, and for named volumes chown only storage and bootstrap/cache in the entrypoint.
Define readiness, liveness and startup as Kubernetes probes; keep HEALTHCHECK only if the image also runs under Compose, pointing both at one endpoint.
Move the runner to a register-run-once-destroy model and run jobs unprivileged; never hand over the Docker socket, and never run fork PRs on it.
Leave the build tools in the builder stage: make the final stage distroless/static or scratch for Go and fpm-alpine for PHP, and run as non-root.
This is an addressing-plan problem, not a routing bug: pin Docker's pool in daemon.json, cut AllowedIPs down to the DB subnet, make routes persistent.