Skip to content
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

ls: improve handling of invalid builders/context, clarify relation with context #1520

Open
thaJeztah opened this issue Jan 15, 2023 · 1 comment
Labels
kind/enhancement New feature or request

Comments

@thaJeztah
Copy link
Member

Related (see further down):

⚠️ Disclaimer: I just ran into this issue on buildx v0.9.1 (Docker Desktop 4.16.1), but have not yet verified the behavior on v0.10.0;

The issue: an invalid builder (context)

When running docker buildx ls, I noticed an error message:

docker buildx ls
NAME/NODE       DRIVER/ENDPOINT STATUS  BUILDKIT                         PLATFORMS
default *       docker
  default       default         running 22.06.0-beta.0-913-g6be7129598.m linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
desktop-linux   docker
  desktop-linux desktop-linux   running 22.06.0-beta.0-913-g6be7129598.m linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
foo                             error

Cannot load builder foo: Unix socket path "/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/TestBuildWithBuildercustom_context67217891/001/docker.sock" is too long

Apparently I have created a custom builder for testing, and that builder could not be used (path too long), so my (logical) approach was to "just remove the builder";

docker buildx rm foo
ERROR: Unix socket path "/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/TestBuildWithBuildercustom_context67217891/001/docker.sock" is too long

That failed, and the builder is still there;

docker buildx ls
NAME/NODE       DRIVER/ENDPOINT STATUS  BUILDKIT                         PLATFORMS
default *       docker
  default       default         running 22.06.0-beta.0-913-g6be7129598.m linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
desktop-linux   docker
  desktop-linux desktop-linux   running 22.06.0-beta.0-913-g6be7129598.m linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
foo                             error

Cannot load builder foo: Unix socket path "/var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/TestBuildWithBuildercustom_context67217891/001/docker.sock" is too long

Relation with "context"

So, I guess the issue here is because docker buildx ls doesn't actually list builders, but lists contexts (and checks each context to see if there's a builder?). This is confusing.

There is indeed a context named foo, and that has a Docker Endpoint with a socket path that's too long (this may be something we should validate when creating the context);

docker context ls
NAME                TYPE                DESCRIPTION                               DOCKER ENDPOINT                                                                                                      KUBERNETES ENDPOINT   ORCHESTRATOR
default *           moby                Current DOCKER_HOST based configuration   unix:///var/run/docker.sock                                                                                                                swarm
desktop-linux       moby                                                          unix:///Users/thajeztah/.docker/run/docker.sock
foo                 moby                                                          unix:///var/folders/6f/tz5jf4nn1_n5jb0ctrrw5p2w0000gn/T/TestBuildWithBuildercustom_context67217891/001/docker.sock

Removing the context worked:

docker context rm foo
foo

And resolved the issue:

docker buildx ls
NAME/NODE       DRIVER/ENDPOINT STATUS  BUILDKIT                         PLATFORMS
default *       docker
  default       default         running 22.06.0-beta.0-913-g6be7129598.m linux/arm64, linux/amd64, linux/amd64/v2, linux/riscv64, linux/ppc64le, linux/s390x, linux/mips64le, linux/mips64
desktop-linux   docker
@thaJeztah thaJeztah added the kind/enhancement New feature or request label Jan 15, 2023
@thaJeztah
Copy link
Member Author

/cc @crazy-max @dvdksn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant