-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Closed
Labels
Milestone
Description
Description
Not sure when this broke (did not yet do a bisect), but I noticed that if the ~/.docker/config.json contains an alias for builder (which happens after running docker buildx install), the CLI is broken;
docker version
not allowed to alias with builtin "buildx" as targetReproduce
make -f docker.Makefile binaryWithout alias installed:
rm ~/.docker/config.json
./build/docker version
Client:
Version: 22.06.0-beta.0-140-g3dad26ca2.m
API version: 1.42
Go version: go1.19.1
Git commit: 3dad26ca2
Built: Wed Sep 28 22:36:09 2022
OS/Arch: darwin/arm64
Context: default
...After running docker buildx install;
./build/docker buildx install
cat ~/.docker/config.json
{
"auths": {},
"aliases": {
"builder": "buildx"
}
}
./build/docker version
not allowed to alias with builtin "buildx" as targetThe error occurs in this part of the code inside processAliases();
Lines 29 to 31 in c780f7c
| if _, _, err := cmd.Find(strings.Split(v, " ")); err == nil { | |
| return args, osArgs, errors.Errorf("not allowed to alias with builtin %q as target", v) | |
| } |
Because the cmd.Find("buildx")) returns a cmd. From a quick test the cmd it finds may be the "stub" command we create for plugins; when disabling the buildx plugin (renaming the file), the problem goes away;
mv /usr/local/lib/docker/cli-plugins/docker-buildx /usr/local/lib/docker/cli-plugins/docker-buildx-disabled
./build/docker version
Client:
Version: 22.06.0-beta.0-140-g3dad26ca2.m
API version: 1.42
Go version: go1.19.1
Git commit: 3dad26ca2
Built: Wed Sep 28 22:36:09 2022
OS/Arch: darwin/arm64
Context: default
...Expected behavior
No response
docker version
current master (built from https://github.com/docker/cli/commit/3dad26ca2d418092b8c4e01b03d0455d583bec86)
Client:
Version: 22.06.0-beta.0-140-g3dad26ca2.m
API version: 1.42
Go version: go1.19.1
Git commit: 3dad26ca2
Built: Wed Sep 28 22:36:09 2022
OS/Arch: darwin/arm64
Context: defaultdocker info
not relevantAdditional Info
No response