Repository navigation
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
Activity
thaJeztah commentedon Sep 28, 2022
@crazy-max PTAL; perhaps you have an idea how we can detect if a command is a "plugin" or not (haven't looked closely yet; perhaps we have annotations we can use)
crazy-max commentedon Sep 29, 2022
@thaJeztah I'm not able to repro with #3314 but with latest changes from master yes. I will take a look.
Edit: was able to bissect and it happens since #3429
thaJeztah commentedon Sep 29, 2022
I have an easy fix for this, but I think it's a partial fix (looking at better fixes that may also help with the performance regression)
Might push the "easy fix" first and fix the rest later
thaJeztah commentedon Sep 29, 2022
opened #3795 with the "easy" fix