buildkit icon indicating copy to clipboard operation
buildkit copied to clipboard

Where is buildkitd.toml when running on WSL2?

Open BtbN opened this issue 3 years ago • 4 comments

Where does one put buildkitd.toml when trying to reduce max-parallelism on WSL2 backed Docker on Windows? I tried all more or less obvious locations I could think of:

  • /etc/buildkit/buildkitd.toml inside of my own WSL2 Distro
  • /etc/buildkit/buildkitd.toml inside of the docker-desktop WSL distro
  • C:\ProgramData\buildkitd\buildkitd.toml on the Host

There is also a suspicious /tmp/docker-desktop-root inside of the docker-desktop WSL distro. It has a bunch of other docker config files in its own /etc. But unfortunately it appears to be mounted from some iso image, and is fully read-only.

Now, where do I actually put the file for it to take effect?

BtbN avatar Jun 11 '22 22:06 BtbN

If you are using buildx you can use docker buildx create --config ./any/path to create buildkit instance in container with a specified config.

Otherwise, path needs to be /etc/buildkit/buildkitd.toml in the environment where buildkitd is running.

tonistiigi avatar Jun 13 '22 22:06 tonistiigi

I explicitly don't want to create a new builder. I'd like to modify the settings of the default one. I have tried /etc/buildkit/buildkitd.toml in all WSL2 environments/distros, but none of them had any effect. Like I said, I also tried the Windows-Path, but it didn't work either.

BtbN avatar Jun 13 '22 22:06 BtbN

Are you asking for the buildkit that is embedded in dockerd (buildx docker driver)? I don't think there is currently a max-parallelism option in dockerd configuration. Would need to be added in https://github.com/moby/moby/blob/master/daemon/config/builder.go#L71

tonistiigi avatar Jun 14 '22 00:06 tonistiigi

Yes. That would certainly explain things. I'll see how easy it is to add and send a PR if I figure it out.

BtbN avatar Jun 14 '22 10:06 BtbN