docker / docker/buildx

cannot create one builder with multiple nodes on same host

Open
#1,717 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug 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
$ /usr/libexec/docker/cli-plugins/buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS  PLATFORMS
default * docker
  default default         running linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

$ /usr/libexec/docker/cli-plugins/buildx create --use    --driver docker-container --name mybuilder --platform linux/amd64 --node node1
mybuilder

$ /usr/libexec/docker/cli-plugins/buildx ls
NAME/NODE   DRIVER/ENDPOINT             STATUS   PLATFORMS
mybuilder * docker-container
  node1     unix:///var/run/docker.sock inactive linux/amd64*
default     docker
  default   default                     running  linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6

$ /usr/libexec/docker/cli-plugins/buildx create --append --driver docker-container --name mybuilder --platform linux/arm64 --node node2
Error: invalid duplicate endpoint unix:///var/run/docker.sock
Usage:
  /usr/libexec/docker/cli-plugins/buildx create [OPTIONS] [CONTEXT|ENDPOINT] [flags]

Flags:
      --append                   Append a node to builder instead of changing it
      --buildkitd-flags string   Flags for buildkitd daemon
      --config string            BuildKit config file
      --driver string            Driver to use (available: [docker docker-container kubernetes])
      --driver-opt stringArray   Options for the driver
  -h, --help                     help for create
      --leave                    Remove a node from builder instead of changing it
      --name string              Builder instance name
      --node string              Create/modify node with given name
      --platform stringArray     Fixed platforms for current node
      --use                      Set the current builder instance

Global Flags:
      --builder string   Override the configured builder instance
Expected behaviour

I'd expect that I can have one builder that has multiple nodes for different architectures on the same (local) host.

Actual behaviour
/usr/libexec/docker/cli-plugins/buildx version
github.com/docker/buildx 0.0.0+unknown

That's weird, but that's what we get when we use amazonlinux:2 ?

docker run -it --rm amazonlinux:2

bash-4.2# amazon-linux-extras install docker -y
...
bash-4.2# /usr/libexec/docker/cli-plugins/buildx version
github.com/docker/buildx 0.0.0+unknown
bash-4.2# docker --version
Docker version 20.10.17, build 100c701
Buildx version

github.com/docker/buildx 0.0.0+unknown

Docker info
docker info
Client:
 Context:    default
 Debug Mode: false

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 43
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: xfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 9cd3357b7fd7218e4aec3eae239db1f68a5a6ec6
 runc version: 5fd4c4d144137e991c4acebb2146ab1483a97925
 init version: de40ad0
 Security Options:
  seccomp
   Profile: default
 Kernel Version: 5.10.167-147.601.amzn2.x86_64
 Operating System: Amazon Linux 2
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 7.663GiB
 Name: ip-10-20-11-55.us-west-2.compute.internal
 ID: KBGO:3A4V:KG6O:YASU:A74Z:2W4B:WEDV:GON6:EPLC:N3AF:N3AD:6OYJ
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: true
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false

also, this might be interesting:

docker run -it --rm amazonlinux:2

bash-4.2# amazon-linux-extras install docker -y
...
bash-4.2# /usr/libexec/docker/cli-plugins/buildx version
github.com/docker/buildx 0.0.0+unknown
bash-4.2# docker --version
Docker version 20.10.17, build 100c701


### Builders list

```text
/usr/libexec/docker/cli-plugins/buildx ls
NAME/NODE   DRIVER/ENDPOINT             STATUS   PLATFORMS
mybuilder * docker-container
  node1     unix:///var/run/docker.sock inactive linux/amd64*
default     docker
  default   default                     running  linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
Configuration
docker run -it --rm amazonlinux:2
amazon-linux-extras install docker -y
/usr/libexec/docker/cli-plugins/buildx ls
/usr/libexec/docker/cli-plugins/buildx create --use    --driver docker-container --name mybuilder --platform linux/amd64 --node node1
mybuilder
/usr/libexec/docker/cli-plugins/buildx create --append --driver docker-container --name mybuilder --platform linux/arm64 --node node2
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 buildx create --append --driver docker-container commands and two nodes using the same local Docker endpoint. Start by tracing the duplicate endpoint error in the builder creation path; done means one builder can contain multiple same-host nodes with different platforms, while existing duplicate-endpoint validation remains correct.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, go
Domain
cli
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.