-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Specifing docker --config
option breaks docker buildx build
command
#5477
Comments
@thaJeztah I can't reproduce but the error printed here("A self-sufficient runtime for containers") is coming from |
I suspect the problem is in this part;
CLI plugins are discovered in a number of locations; some "system-wide", and some "per user"
The last one allows overriding the system-installed version, but I think the Trying to mimic that situation; docker run -it --rm -v /var/run/docker.sock:/var/run/docker.sock docker:cli
apk add -qq --no-cache js
docker info --format '{{json .ClientInfo.Plugins}}' | jq .
[
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v0.17.1",
"ShortDescription": "Docker Buildx",
"Name": "buildx",
"Path": "/usr/local/libexec/docker/cli-plugins/docker-buildx"
},
{
"SchemaVersion": "0.1.0",
"Vendor": "Docker Inc.",
"Version": "v2.29.7",
"ShortDescription": "Docker Compose",
"Name": "compose",
"Path": "/usr/local/libexec/docker/cli-plugins/docker-compose"
}
] Moving the plugins to mkdir -p ~/.docker/cli-plugins/
mv usr/local/libexec/docker/cli-plugins/* ~/.docker/cli-plugins/ Without custom config-dir; docker build --help
Start a build
Usage: docker buildx build [OPTIONS] PATH | URL | -
Start a build
... With a custom config-dir; docker --config=/foo/ build --help
DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/buildx/
Usage: docker build [OPTIONS] PATH | URL | - |
This is somewhat of a known issue; there's various tickets (and backlog items) related to revamping storage locations (also in relation to rootless mode, which has some additional logic, and use of XDG directories). While it's a known issue, it's grown to be more problematic with the introduction of many plugins, and other parts of docker (ab)using It's not a trivial thing to change though, as there's many tools that implemented these paths and logic, so at least it will require a long transition period; it will also involve changes in Docker Desktop (which uses this location for various purposes as well, including cli-plugins it ships). Let me at least transfer this ticket to the CLI repository, which has the core parts of this logic, and link it from the internal backlog item(s) related to this. |
on my mac I get the following:
|
Contributing guidelines
I've found a bug and checked that ...
Description
I use different
DOCKER_CONFIG
directories to switch among different tenants of the same Container Registry.Recently, I found that when I set the
DOCKER_CONFIG
directory parameter, whether through the--config
parameter or theDOCKER_CONFIG
environment variable, thedocker buildx build
command parameter parsing will be completely messed up, reporting that--platform
,-t
and other parameters cannot be recognized.Expected behaviour
Command like
docker --config /path/to/custom-config-dir buildx build --platform linux/amd64 -t myimage1 -t myimage2 --build-arg APP_NAME=server --push .
should work
Actual behaviour
An error raised:
When I omit
--config
option, everything works.Even if I set
DOCKER_CONFIG
environment variable, it will also fall.Buildx version
github.com/docker/buildx v0.16.2-desktop.1 081c21b9e461293ae243a1ff813a680a4f5f8fb9
Docker info
Builders list
Configuration
Build logs
No response
Additional info
No response
The text was updated successfully, but these errors were encountered: