> Buildkit doesn't create special containers for itself? It's literally a service integrated into dockerd.
No, it's not. It's a utility container that is hidden from the normal "docker ps". You can see it easily when you use docker-compose with podman.
The easiest way to see it in regular Docker is to create a simple Dockerfile with 'RUN sleep 1000' at the end and start building it. Then enter the Docker host ("docker run -it --rm --privileged --pid=host justincormack/nsenter1") and do 'mount' to see the mounts.
You'll see that buildkit will have its own overlay tree ('/var/lib/docker/buildkit/containerd-overlayfs') and the executor will have its own separate branch too. However, they do share the layers. Now wait for the container to complete building and run it.
You'll see that the running container uses an entirely _different_ set of layers. There is no reuse of layers between the buildkit and the running image.
Yes, the Docker buildkit is technically a daemon that is co-located with dockerd and just runs in its own cgroup tree. But it might as well be remote, because the resulting image runs in a completely different environment.
And the way the image is transferred from buildkit is through the containerd. Which is another separate container in the "moby" namespace.
> No, it supports anything Buildkit can fetch: git, http, client dir... for that matter the client itself can shim that to be whatever it wants.
Any examples?
> You can cache to GitHub actions cache, S3, az blob, gcs, registries, or export to the client.
First, you can build the base image, with the GHA or registry cache. It works. But the `proto` stage will never use cache. The "base" image is supplied through an additional context.
If by "utility" container you mean the containers aren't managed under the same stack, that is true.
Buildkit, at least prior to docker 29, executes runc directly.
It is still using the same storage backend, though there is a shim involved to convert docker's (now deprecated) graph drivers to containerd's snapshotter interface which is what Buildkit speaks. That's why there is a different tree.
As of docker 29, containerd's storage is used by default.
I can't recall if this used containerd to execute containers or just storage.
> > No, it supports anything Buildkit can fetch: git, http, client dir... for that matter the client itself can shim that to be whatever it wants.
> Any examples?
Then you can "FROM foo" or whatever you want to do with that context.
> First, you can build the base image, with the GHA or registry cache. It works. But the `proto` stage will never use cache. The "base" image is supplied through an additional context.
What are you expecting to cache here?
Are you saying using an extra context like this is preventing it from using the cache?
Buildkit doesn't create special containers for itself? It's literally a service integrated into dockerd.
> Which can only refer to images that are built inside this particular buildkit or are pullable from a repo.
No, it supports anything Buildkit can fetch: git, http, client dir... for that matter the client itself can shim that to be whatever it wants.
> This is really all I want, a way to quickly reused the previous state saved in some format in Github Cache, NFS, or other storage.
You can cache to GitHub actions cache, S3, az blob, gcs, registries, or export to the client.
Anything you want to stick it on is going to require copying the data, and yeah that's going to be expensive.