A build is slow because of a 2 GB context. How do you diagnose and fix it?
BeginnerProductionBuild Performance & CI
Answer
The output line transferring context: 2.1GB gives it away. Find large dirs with du -sh * | sort -h, add them to .dockerignore (node_modules, .git, dist, datasets, *.tar), or use a whitelist style (* then !src, !package.json). With BuildKit, --progress=plain shows each step's timing.
More on Build Performance & CI
How do you make Docker builds fast in CI where runners are ephemeral?BeginnerWhat are the cache backends in buildx?BeginnerWhy does `inline` cache often disappoint?AdvancedHow do you structure a Python Dockerfile for the best caching and size?IntermediateHow do you structure a Node.js production image?IntermediateHow do you build a small Java image?Beginner