Speeding up Docker builds in CI with BuildKit

No one enjoys waiting, and waiting for your software to build and tests to run isn’t fun either—in fact, it’s quite expensive.
And if you’re building your Docker image in a CI system like GitHub Actions with ephemeral runners—where a new environment gets spinned up for every build—by default your builds are going to be extra slow.

In particular, when you spin up a new VM with a new Docker instance, the cache is empty, so when you run the Docker build your image has to be built from scratch.

Luckily, Docker includes some features to allow you to warm up the cache, by pulling previous versions of the image.
And the newer BuildKit build system improves this even further—but also requires some changes, otherwise caching

 

 

 

To finish reading, please visit source site