Jump to content

Docker (software): Difference between revisions

Line 208: Line 208:
Alternative public registries:
Alternative public registries:
* [https://gallery.ecr.aws/ AWS ECR Gallery] has a mirror for all official docker containers.
* [https://gallery.ecr.aws/ AWS ECR Gallery] has a mirror for all official docker containers.
==Caching==
If you want your builds to be fast on CICD, you have to setup [https://docs.docker.com/build/cache/ caching].
In particular you should:
* Enable [https://docs.docker.com/build/buildkit/ buildkit] by setting the environment variable <code>DOCKER_BUILDKIT=1</code>
* Use <code>--cache-from</code> in your build.
* Setup external caching, e.g. with <code>--build-arg BUILDKIT_INLINE_CACHE=1</code>.
** Use <code>--arg BUILDKIT_INLINE_CACHE=1</code> if using <code>docker buildx build</code>.
* For multistage builds, cache each stage in your container registry.
;Resources
* https://michalwojcik.com.pl/2021/01/21/using-cache-in-multi-stage-builds-in-gitlab-ci-docker/
* https://testdriven.io/blog/faster-ci-builds-with-docker-cache/#multi-stage-builds


==Useful Services==
==Useful Services==