-
Notifications
You must be signed in to change notification settings - Fork 616
vendor: github.com/moby/moby/api v1.52.0, moby/client v0.1.0 #3326
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
Conversation
2a8cb2e to
d95a6e4
Compare
b38ce36 to
b2b1838
Compare
af0516f to
ac1ad8e
Compare
82ff223 to
62592fb
Compare
62592fb to
2bc0c39
Compare
af171bc to
d7eb935
Compare
d7eb935 to
78222ab
Compare
53275e1 to
79a35cd
Compare
79a35cd to
dc504d1
Compare
dc504d1 to
ca28e2e
Compare
3c00d0e to
f52e45d
Compare
f52e45d to
b3e2727
Compare
b3e2727 to
a736ed2
Compare
a736ed2 to
2e675c1
Compare
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2e675c1 to
18dc2e0
Compare
| github.com/docker/cli v29.0.0+incompatible | ||
| github.com/docker/cli-docs-tool v0.10.0 | ||
| github.com/docker/docker v28.5.1+incompatible | ||
| github.com/docker/docker v28.5.2+incompatible |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like we keep this module only for the namesgenerator package:
Line 8 in c1fbb49
| "github.com/docker/docker/pkg/namesgenerator" |
Seems it has moved to an internal package since v29: https://github.com/moby/moby/tree/master/internal/namesgenerator which relates to this opened PR #3354
@thaJeztah I wonder if this package could be moved to client/pkg like you have done for pkg/stringid in moby/moby#50504 so we avoid multiple implementation and fragmentation across projects?
No, this package was never meant to be used by any client; it's a fallback for the daemon if a name is omitted. There's been various conversations to consider removing it entirely (possibly using plain GUIDs or PERHAPS adding an option for users to provide a prefix, which could work for buildx) I think we should look if buildx needs to generate a name at all, but if it does, I think it should actually use its own naming scheme instead of the same scheme as the docker daemon uses for generated names; I think the current approach is to some extend even more confusing, because these names don't directly correlate with container names, only builder names; If I see it correctly, the current approach is for buildx to generate a name, and as part of that check if there's no builders that have that name; docker buildx create
charming_nashHowever, it (by default) does not create an actual container at that point, it only defines a builder "template" for container(s) to be created, but it does show an "inactive" instance; docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
charming_nash docker-container
\_ charming_nash0 \_ desktop-linux inactive
...But that instance doesn't exist yet, so .. it's not really "inactive"; it doesn't exist yet; docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESThis part is already slightly confusing, because it shows the name of a builder instance that doesn't exist (and buildx doesn't allow picking an instance, or is that the docker buildx use charming_nash0
ERROR: failed to find instance "charming_nash0": open /Users/thajeztah/.docker/buildx/instances/charming_nash0: no such file or directoryUsing the builder; docker buildx use --builder charming_nash0 charming_nash
Setting the docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
charming_nash* docker-container
\_ charming_nash0 \_ desktop-linux inactive
...No container created up until this point; docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESWhen building, the container is bootstrapped; echo 'FROM alpine' | docker buildx build --quiet -
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --loadAnd now a container IS created, but it doesn't use the naming scheme as-is, but an additional prefix; docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
e816a30f4fc8 moby/buildkit:buildx-stable-1 "buildkitd --allow-i…" 21 seconds ago Up 21 seconds buildx_buildkit_charming_nash0This also means that there's a TOCTOU issue here as well; with these names being predictable, I can create a container with the expected to be used name; docker buildx create
lucid_hypatia
docker run -d --name buildx_buildkit_lucid_hypatia0 nginx:alpine
37084e0cf8c4cdf5272699274db4fe2b8d1e3ff76796c99f544f8a3240e8e51e
docker buildx use --builder lucid_hypatia0 lucid_hypatia
docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
lucid_hypatia* docker-container
\_ lucid_hypatia0 \_ desktop-linux error
...
Failed to get status for lucid_hypatia (lucid_hypatia0): listing workers: failed to list workers: Unavailable: connection error: desc = "error reading server preface: http2: frame too large"
echo 'FROM alpine' | docker buildx build --quiet -
WARNING: No output specified with docker-container driver. Build result will only remain in the build cache. To push result image into registry use --push or to load image into docker use --load
ERROR: failed to build: listing workers for Build: failed to list workers: Unavailable: connection error: desc = "error reading server preface: http2: frame too large"Based on the above;
Some possible alternatives; Use labels and/or annotations instead of depending on the name.I think in general, the reason for these names are for buildx to be able to correlate containers with its builders. This is similar to docker compose, which also needs to do this, and historically used the container name for this purpose. Instead of using the name, buildx can use labels or annotations (although we currently lack many options for filtering on annotations). The intent for these containers is to be managed by For fun, I checked what would happen with a container that happened to be named following buildx's naming scheme, and it looks like 💥 buildx happily removes my container; docker buildx create
silly_chatelet
docker run -d --name buildx_buildkit_silly_chatelet0 nginx:alpine
90290ff3b5c85ed2724769384facc628b46404c36e246e8f26dd3b1d10fe4f03
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
90290ff3b5c8 nginx:alpine "/docker-entrypoint.…" 13 seconds ago Up 12 seconds 80/tcp buildx_buildkit_silly_chatelet0
docker buildx rm silly_chatelet
silly_chatelet removed
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMESUsing labels and/or annotations to identify if a container is a container managed by / created by buildx would also avoid the above. Alternative ideas
docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
lucid_hypatia* docker-container
\_ lucid_hypatia0 \_ desktop-linux error
silly_chatelet docker-container
\_ silly_chatelet0 \_ desktop-linux inactive
strange_bardeen docker-container
\_ strange_bardeen0 \_ desktop-linux inactive
default docker
\_ default \_ default running v0.25.1 linux/amd64 (+2), linux/arm64, linux/ppc64le, linux/s390x, (2 more)
desktop-linux docker
\_ desktop-linux \_ desktop-linux running v0.25.1 linux/amd64 (+2), linux/arm64, linux/ppc64le, linux/s390x, (2 more)We may have something like this (just a really quick write-up without giving it much thought); docker buildx ls
CONTEXT/INSTANCE DRIVER STATUS BUILDKIT PLATFORMS
desktop-linux *
\_ desktop-linux docker running v0.25.1 linux/amd64 (+2), linux/arm64, linux/ppc64le, linux/s390x, (2 more)
\_ desktop-linux0 docker-container error
\_ desktop-linux1 docker-container inactiveI'm not 100% sure what the exact use-cases are for multiple builders per context; I could see this being to namespace builds, but (see my earlier comment), perhaps that's something we should look into in a wider scope to namespace objects (containers, volumes, builders, networks). |
Uh oh!
There was an error while loading. Please reload this page.