docker buildx build --cache-from type=gha --cache-to type=gha,mode=max -t myapp .

Category: Docker

docker buildx build --cache-from type=gha --cache-to type=gha,mode=max -t myapp .

Build with GitHub Actions layer cache

buildx = Docker's modern multi-platform builder powered by BuildKit. The gha cache type stores image layers in GitHub Actions' cache service, so CI builds reuse unchanged steps and finish faster. mode=max also caches intermediate layers instead of only the final image. Pair --cache-from with the same cache to warm later builds.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.