The following guides provide optimal Dockerfiles that are tailored for Depot container build cache and your preferred programming language. You can use these Dockerfiles as reference implementations or starting points for your own projects.
If you already have a Dockerfile and want to optimize it for your Depot builds, refer to the Understanding BuildKit Cache Mounts section in each guide. This section explains:
RUN commandsid, target, sharing)The cache mount integration is the core enhancement that makes builds significantly faster on Depot, and these sections provide everything you need to retrofit your existing Dockerfiles. For more in-depth information on BuildKit cache mounts, please refer to the blog post How to use cache mounts to speed up Docker builds.