DevOps Blog - Nicolas Paris

How Could I miss Docker BuildKit


This is a three parts serie about Docker best practice.

Test with a multiple stage build, the one I was working on.

It's in the official documentation

Easy to try :

DOCKER_BUILDKIT=1 docker build .

Easy to setup a gitlab-runner with this, in /etc/docker/daemon.json.

{ "features": { "buildkit": true } }

The big win I see is with multi-stage build like the one I use everywhere

With normal compilation, you dont start other stage before the first one is finish. Now, with BuildKit, it's run in parallele, it will wait when result of a compilation is really needed! This is awesome!

I might spot some other benefits as well, but this one is a big advantage.

The only reason to not use this it seems the windows compability but I'm not concern. Just go for it then.

In this example, white parts of the build are run at the same time.