docker / docker/buildx

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

Open
#2,345 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status/triage
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

Contributing guidelines
I've found a bug and checked that ...
  • ... the documentation does not mention anything about my problem
  • ... there are no open or closed issues that are related to my problem
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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the docker context create builder and docker buildx create --name builder --use builder commands on the affected versions. Trace the docker buildx create entry point and its handling of an existing context, then verify that the existing-name case reports a warning and exits successfully so the OCI image build can continue.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli, devtools
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.