docker / buildx

Docker CLI plugin for extended build capabilities with BuildKit
Apache License 2.0
3.35k stars 455 forks source link

docker buildx create command is failing when there is an existing builder created with a context creation #2345

Open dvdoron opened 4 months ago

dvdoron commented 4 months ago

Contributing guidelines

I've found a bug and checked that ...

Description

Starting buildx version 0.13.0, the behavior of the "docker buildx create" command has changed.

The creation of a new builder fails when there is an existing builder already. In my case, I'm creating a context called "builder," so all the builds will run in a remote docker host like this:

docker context create builder --docker "host=tcp://xx.xx.xx.xx:2367"

Then, I need to create the builder (or modify the one made with the context creation) so it will use the docker-container driver to create OCI images.

docker buildx create --name builder --use builder

On version 0.12.1 of the buildx extension, I got a warning that the builder is exist WARNING: instance name "builder" already exists as context builder

On version 0.13.0, I got this error instead: ERROR: instance name "builder" already exists as context builder

Expected behaviour

Throw a warning message, and continue with the OCI image build: WARNING: instance name "builder" already exists as context builder

Actual behaviour

It's throwing an error message and exiting with exit code 1 ERROR: instance name "builder" already exists as context builder

Buildx version

0.13.0

Docker info

No response

Builders list

NAME/NODE     DRIVER/ENDPOINT   STATUS    BUILDKIT               PLATFORMS
builder       docker                                             
 \_ builder    \_ builder       running   v0.11.7+d3e6c1360f6e   linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6
default*      docker                                             
 \_ default    \_ default       running   v0.11.7+d3e6c1360f6e   linux/amd64, linux/amd64/v2, linux/amd64/v3, linux/arm64, linux/riscv64, linux/ppc64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6

Configuration

-

Build logs

No response

Additional info

No response

bytestream commented 1 month ago

@dvdoron did you find a workaround, other than avoiding 0.13.0+?