diff --git a/_vendor/github.com/docker/cli/docs/reference/commandline/dockerd.md b/_vendor/github.com/docker/cli/docs/reference/commandline/dockerd.md index f290045471..9a62bbf97d 100644 --- a/_vendor/github.com/docker/cli/docs/reference/commandline/dockerd.md +++ b/_vendor/github.com/docker/cli/docs/reference/commandline/dockerd.md @@ -46,6 +46,7 @@ Options: --default-gateway ip Container default gateway IPv4 address --default-gateway-v6 ip Container default gateway IPv6 address --default-ipc-mode string Default mode for containers ipc ("shareable" | "private") (default "private") + --default-network-opt mapmap Default network options (default map[]) --default-runtime string Default OCI runtime for containers (default "runc") --default-shm-size bytes Default shm size for containers (default 64MiB) --default-ulimit ulimit Default ulimits for containers (default []) @@ -1449,6 +1450,7 @@ This is a full example of the allowed configuration options on Linux: "default-cgroupns-mode": "private", "default-gateway": "", "default-gateway-v6": "", + "default-network-opts": {}, "default-runtime": "runc", "default-shm-size": "64M", "default-ulimits": { @@ -1566,6 +1568,7 @@ This is a full example of the allowed configuration options on Windows: "containerd-plugin-namespace": "docker-plugins", "data-root": "", "debug": true, + "default-network-opts": {}, "default-runtime": "", "default-ulimits": {}, "dns": [], @@ -1711,3 +1714,50 @@ $ sudo dockerd \ --data-root=/var/lib/docker-bootstrap \ --exec-root=/var/run/docker-bootstrap ``` + +### Default network options + +The `default-network-opts` key in the `daemon.json` configuration file, and the +equivalent `--default-network-opt` CLI flag, let you specify default values for +driver network driver options for new networks. + +The following example shows how to configure options for the `bridge` driver +using the `daemon.json` file. + +```json +{ + "default-network-opts": { + "bridge": { + "com.docker.network.bridge.host_binding_ipv4": "127.0.0.1", + "com.docker.network.bridge.mtu": "1234" + } + } +} +``` + +This example uses the `bridge` network driver. Refer to the +[bridge network driver page](https://docs.docker.com/network/drivers/bridge/#options) +for an overview of available driver options. + +After changing the configuration and restarting the daemon, new networks that +you create use these option configurations as defaults. + +```console +$ docker network create mynet +$ docker network inspect mynet --format "{{json .Options}}" +{"com.docker.network.bridge.host_binding_ipv4":"127.0.0.1","com.docker.network.bridge.mtu":"1234"} +``` + +Note that changing this daemon configuration doesn't affect pre-existing +networks. + +Using the `--default-network-opt` CLI flag is useful for testing and debugging +purposes, but you should prefer using the `daemon.json` file for persistent +daemon configuration. The CLI flag expects a value with the following format: +`driver=opt=value`, for example: + +```console +$ sudo dockerd \ + --default-network-opt bridge=com.docker.network.bridge.host_binding_ipv4=127.0.0.1 \ + --default-network-opt bridge=com.docker.network.bridge.mtu=1234 +``` diff --git a/_vendor/modules.txt b/_vendor/modules.txt index e84adaec27..b2a1904d0e 100644 --- a/_vendor/modules.txt +++ b/_vendor/modules.txt @@ -2,7 +2,7 @@ # github.com/moby/buildkit v0.13.0-beta1.0.20231011101155-c444964c2e8f # github.com/docker/buildx v0.11.2 # github.com/docker/scout-cli v1.0.9 -# github.com/docker/cli v24.0.6+incompatible +# github.com/docker/cli v24.0.8-0.20231106123152-48ec4f339e2b+incompatible # github.com/docker/compose-cli v1.0.35 # github.com/compose-spec/compose-spec v0.0.0-20230927132538-f223c5150d5d # github.com/docker/compose/v2 v2.23.0 diff --git a/go.mod b/go.mod index bd6a3d6de6..aeaed7067c 100644 --- a/go.mod +++ b/go.mod @@ -7,7 +7,7 @@ toolchain go1.21.1 require ( github.com/compose-spec/compose-spec v0.0.0-20230927132538-f223c5150d5d // indirect github.com/docker/buildx v0.11.2 // indirect - github.com/docker/cli v24.0.6+incompatible // indirect + github.com/docker/cli v24.0.8-0.20231106123152-48ec4f339e2b+incompatible // indirect github.com/docker/compose-cli v1.0.35 // indirect github.com/docker/compose/v2 v2.23.0 // indirect github.com/docker/scout-cli v1.0.9 // indirect diff --git a/go.sum b/go.sum index 1e5d91baa3..6cddd79f38 100644 --- a/go.sum +++ b/go.sum @@ -56,6 +56,8 @@ github.com/docker/cli v24.0.5+incompatible h1:WeBimjvS0eKdH4Ygx+ihVq1Q++xg36M/rM github.com/docker/cli v24.0.5+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/cli v24.0.6+incompatible h1:fF+XCQCgJjjQNIMjzaSmiKJSCcfcXb3TWTcc7GAneOY= github.com/docker/cli v24.0.6+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/cli v24.0.8-0.20231106123152-48ec4f339e2b+incompatible h1:tXZk7C97vINae9YYzPtqoClal32VoMl8gz6gLjJ6Kdg= +github.com/docker/cli v24.0.8-0.20231106123152-48ec4f339e2b+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= github.com/docker/compose-cli v1.0.35 h1:uZyEHLalfqBS2PiTpA1LAULyJmuQ+YtZg7nG4Xl3/Cc= github.com/docker/compose-cli v1.0.35/go.mod h1:mSXI4hFLpRU3EtI8NTo32bNwI0UXSr8jnq+/rYjGAUU= github.com/docker/compose/v2 v2.22.0 h1:3rRz4L7tPU75wRsV8JZh2/aTgerQvPa1cpzZN+tHqUY=