mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-05-18 00:47:48 +08:00

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 <jonathan.sternberg@docker.com>