Example usage of BuildKit cache mount and pnpm
for efficient dependency download and image build.
Requires Docker 20+
docker build -f Dockerfile.nobuildkit .
docker buildx build .
See Dockerfile for detailed setup.
With a network speed of approximatively ~1MB/s using Ubuntu 20.04, 16Go RAM and 8x1.80GHz CPUs
Classic Docker build | BuildKit with cache mounts | |
---|---|---|
No cache | 106s | 90s |
Dependency install cache invalidated | 92s | 20s |