Support Docker BuildKit
complete
D
David Aghassi
As of 18.09, docker daemon supports a new features called build kit. Currently (at least on Enterprise) the daemon does not have the feature flag set to enable build kit. It would be nice if Circle would support build kit going forwards
CCI-I-1003
Merged in a post:
Add Support for Docker buildkit
L
Lev
If a user tries to use Docker buildkit, they get an error message:
buildkit not supported by daemon
According to the official docs (https://docs.docker.com/develop/develop-images/build_enhancements/), the requirements are:
Docker 18.09
docker-ce x86_64, ppc64le, s390x, aarch64, armhf; or docker-ee x86_64 only
Network connection required for downloading images of custom frontends
CCI-I-1054
Liya Ai
Hi Toby - I'm checking with the team & will have them respond. Thanks!
T
Toby Pinder
This absolutely does not appear to work out of the box. DOCKER_BUILDKIT=1 is added and CircleCI exits with buildkit not supported by daemonExited with code exit status 1CircleCI received exit code 1This is all with a remote docker of version: 19.03.12which is later than the stated version that this is supposed to be supported on.---Status of this issue appears to have been changed to "shipped" but there does not appear to be any official documentation on how to perform this, and the examples suggested by other users in this thread do not appear to be functioning correctly.Can I suggest that this is reinvestigated to confirm that buildkit is supported before being marked as shipped?
S
Stella Lok
Toby Pinder Here's a complete config that illustrates using BuildKit, could you give it a try? https://gist.github.com/lokst/94fdee2587311102bb4cf506fc96de6a
S
Stella Lok
This is supported in CircleCI by either specifying a remote docker version that is at least 18.09+ or machine executor image with docker version >=18.09 (e.g. "ubuntu-1604:202007-01"). The easiest way to use buildkit is then to set DOCKER_BUILDKIT=1, like below build: docker: - image: circleci/golang steps: - checkout - setup_remote_docker: version: 18.09.3 - run: name: Test building with Buildkit command: | export DOCKER_BUILDKIT=1 docker build --secret id=mysite.key,src=secret -t myimage .
D
Dominik K
It's supported in
setup_remote_docker
version 18.09.3
. See https://ideas.circleci.com/ideas/CCI-I-1003D
Dominik K
I can confirm that
DOCKER_BUILDKIT
works. Successfully tried the example of [RUN --mount=type=ssh
](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/docs/experimental.md#run---mounttypessh).M
Matthew Morrissette Vance
This is implemented now. Just update your "version" to 18.09.3 in "setup_remote_docker" and specify "DOCKER_BUILDKIT" environment variable set to "1" in your Docker build step.
M
Matthew Morrissette
This is extremely important for my team. Our builds are extremely slow without buildkit.
T
Toby Pinder
Buildkit is very nice and would certainly like to see this.