Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Fix wrong bridge driver option #2984

Merged
merged 1 commit into from May 31, 2021
Merged

Conversation

pn11
Copy link
Contributor

@pn11 pn11 commented Feb 26, 2021

- What I did

Fixed a wrong bridge driver option for docker network create.

- How I did it

Fixed documentation.

- How to verify it

With the option in current documentation, the name of the interface in a container remains unchanged (eth0).

$ docker network create -d bridge --opt com.docker.network.container_interface_prefix=moby my-bridge
a6de36dff4b47db04bfd0ce72115d6a071401f82be653cfdd2ee4b805ba2c22a

$ docker run -it --network=my-bridge alpine ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
257425: eth0@if257426: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:c0:a8:30:02 brd ff:ff:ff:ff:ff:ff

With com.docker.network.container_iface_prefix, it works perfectly.

$ docker network create -d bridge --opt com.docker.network.container_iface_prefix=moby my-bridge
ca7448ba52d293a34ca1a1336c54f654c9cd5d5abe17b3d86c0de2f71291440f

$ docker run -it --network=my-bridge alpine ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
257428: moby0@if257429: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP
    link/ether 02:42:c0:a8:40:02 brd ff:ff:ff:ff:ff:ff

- Description for the changelog

N/A

- A picture of a cute animal (not mandatory but encouraged)

This is Pui Pui Molcar, a stop-motion anime featuring Molmots, booming in Japan. (@molcar_anime)

EsDKv6VVkAIPNqO

@pn11 pn11 requested a review from thaJeztah as a code owner February 26, 2021 15:21
Signed-off-by: OKA Naoya <git@okanaoya.com>
Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@@ -175,7 +175,7 @@ equivalent docker daemon flags used for docker0 bridge:
| `com.docker.network.bridge.enable_icc` | `--icc` | Enable or Disable Inter Container Connectivity |
| `com.docker.network.bridge.host_binding_ipv4` | `--ip` | Default IP when binding container ports |
| `com.docker.network.driver.mtu` | `--mtu` | Set the containers network MTU |
| `com.docker.network.container_interface_prefix` | - | Set a custom prefix for container interfaces |
| `com.docker.network.container_iface_prefix` | - | Set a custom prefix for container interfaces |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm.. good catch; looks indeed the correct name; https://github.com/moby/moby/blob/a8a769f04f7ae44117772943ef0f4607b54e05ff/vendor/github.com/docker/libnetwork/netlabel/labels.go#L54-L55

// ContainerIfacePrefix can be used to override the interface prefix used inside the container
ContainerIfacePrefix = Prefix + ".container_iface_prefix"

Looks like moby/moby#31811 updated the changelog incorrectly, probably because the title of the libnetwork pull request had the wrong name in it (I just fixed that); moby/libnetwork#1667

@thaJeztah
Copy link
Member

thaJeztah commented May 31, 2021

opened moby/moby#42446 and docker/docs#12921 to fix the changelog entry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants