How Could I miss Docker BuildKit
DockerThis is a three parts serie about Docker best practice.
- Docker Best Practice latest tag
- Docker Best Practice, Multi-Stage Build
- How Could I miss Docker BuildKit
Test with a multiple stage build, the one I was working on.
- Normal build : 230s
- BuildKit : 100s
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.
- Next: YAML is everywhere in the DevOps World
- Previous: 12 Useful Tools for DevOps