Docker build caching in CI (for multi-stage builds)

How and why to set up registry build caching in CI, with a GitLab example