Skip to content

Commit e06aa17

Browse files
authored
Merge pull request #25241 from dvdksn/worktree-buildkit-cni-bridge
build: document built-in CNI bridge networking for BuildKit
2 parents 9ac9c0c + 5a45672 commit e06aa17

1 file changed

Lines changed: 23 additions & 3 deletions

File tree

content/manuals/build/buildkit/configure.md

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,9 +136,29 @@ $ docker buildx build --push --tag myregistry.com/myimage:latest .
136136
## CNI networking
137137
138138
CNI networking for builders can be useful for dealing with network port
139-
contention during concurrent builds. CNI is [not yet](https://github.com/moby/buildkit/issues/28)
140-
available in the default BuildKit image. But you can create your own image that
141-
includes CNI support.
139+
contention during concurrent builds.
140+
141+
### Bridge networking
142+
143+
The BuildKit image ships with a built-in bridge network provider that uses a
144+
minimal set of bundled CNI plugins, so you don't need to build a custom image
145+
or supply your own CNI configuration. To use it, set the worker network mode to
146+
`bridge` when you create the builder:
147+
148+
```console
149+
$ docker buildx create --use --bootstrap \
150+
--name mybuilder \
151+
--driver docker-container \
152+
--buildkitd-flags "--oci-worker-net=bridge"
153+
```
154+
155+
BuildKit creates a `buildkit0` bridge with a default subnet of `10.10.0.0/16`,
156+
and cleans up the bridge automatically when the daemon shuts down.
157+
158+
### Custom CNI configuration
159+
160+
For more control over networking, build a custom BuildKit image with your own
161+
CNI configuration and plugins.
142162
143163
The following Dockerfile example shows a custom BuildKit image with CNI support.
144164
It uses the [CNI config for integration tests](https://github.com/moby/buildkit/blob/master//hack/fixtures/cni.json)

0 commit comments

Comments
 (0)