dockerdockerfiledocker-buildkit

How do I attach to intermediate docker container when building with buildkit


I recently heard about Buildkit and have been trying to use it with Docker.

I'm using DOCKER_BUILDKIT=1 docker build . -t experimental to build my Dockerfile.

My Dockerfile doesn't build properly because of some missing dependant packages.

What I want to do is to attach to the last working intermediate container and fix the problem with say, apt tools.

When building without Buildkit, this would have been possible with the hash values of intermediate containers from the terminal output.

However, the output from Buildkit is not providing me such values. So, is there any way for me to access them?

Thanks in advance.


Solution

  • I think it is not possible at the moment see buildkit/issue#1472.

    But BuildKit still caches all layers so you could use a work around.