-
Notifications
You must be signed in to change notification settings - Fork 485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
driver: docker-container driver uses --config correctly in rootless mode #2093
Conversation
@AkihiroSuda Looking at the issue, isn't the problem in incorrectly detecting rootless paths used by buildkit. There is no |
I would agree that maybe But maybe one solution could be to use a path that is writable by any user (like |
Yes it seems buildkitd configuration is saved to the default location within the container when the builder is created: buildx/driver/docker-container/driver.go Line 470 in 7838ade
buildx/util/confutil/container.go Line 20 in 7838ade
|
Two comments.
I like this. I took a simple look and it looks like
Even with the above, I still think this is probably the best way to go. Explicitly setting I am a bit confused by the |
I agree that having the file under |
I tested this and it works. Here's the output before the change:
Here's the logs after the change:
|
The `docker-container` driver relies on the default config file location for buildkit when writing the configuration file. When run in a rootless version of docker (dind), the default location is different. Instead of trying to figure out where the appropriate default location is, this just writes the files to the same location and sets the `--config` parameter explicitly. This flag is placed first so a user-specified config option in `--buildkitd-flags` will take precedence over the implicit config parameter. This also fixes the `--config` option with the rootless image. Previously, the config directory was being copied in a way that rendered `/etc` unreadable and the configuration file wasn't readable either. It also wasn't copied to the correct place. Now, `--config` is used to specify the directory, `/etc` isn't included in the copied archive (so the permissions aren't overwritten), and the directory is set as world readable to be readable from the rootless buildkit process`. Signed-off-by: Jonathan A. Sternberg <[email protected]>
a0b218f
to
3f42346
Compare
I made a modification to this so now the Previously, the config directory was being copied with permissions of Now, it does not overwrite |
The
docker-container
driver relies on the default config file locationfor buildkit when writing the configuration file. When run in a rootless
version of docker (dind), the default location is different.
Instead of trying to figure out where the appropriate default location
is, this just writes the files to the same location and sets the
--config
parameter explicitly. This flag is placed first so auser-specified config option in
--buildkitd-flags
will take precedenceover the implicit config parameter.
This also fixes the
--config
option with the rootless image.Previously, the config directory was being copied in a way that rendered
/etc
unreadable and the configuration file wasn't readable either. Italso wasn't copied to the correct place. Now,
--config
is used tospecify the directory,
/etc
isn't included in the copied archive (sothe permissions aren't overwritten), and the directory is set as world
readable to be readable from the rootless buildkit process`.
Fixes #2092.