You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buildx/docs/guides/custom-network.md

1.6 KiB

Using a custom network

Create a network named foonet:

$ docker network create foonet

Create a docker-container builder named mybuilder that will use this network:

$ docker buildx create --use \
  --name mybuilder \
  --driver docker-container \
  --driver-opt "network=foonet"

Boot and inspect mybuilder:

$ docker buildx inspect --bootstrap

Inspect the builder container and see what network is being used:

$ docker inspect buildx_buildkit_mybuilder0 --format={{.NetworkSettings.Networks}}
map[foonet:0xc00018c0c0]

What's buildx_buildkit_mybuilder0?

buildx_buildkit_mybuilder0 is the container name. It can be broken down like this:

  • buildx_buildkit_ is a hardcoded prefix
  • mybuilder0 is the name of the node (defaults to builder name + position in the list of nodes)
$ docker buildx ls
NAME/NODE     DRIVER/ENDPOINT                        STATUS                 PLATFORMS
mybuilder *   docker-container
  mybuilder0  unix:///var/run/docker.sock            running                linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/mips64le, linux/mips64, linux/arm/v7, linux/arm/v6     
default       docker
  default     default                                running                linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6