moby: Missing Gateway field in `bridge` network inspect
First time daemon is booted (no docker0
bridge present, no or empty /var/lib/docker/network/files/local-kv.db
file), IPAM.Config structure in network inspect output will not contain the Gateway field
$ docker network inspect bridge
[
{
"Name": "bridge",
"Id": "2b5cc5f97b6de6a5e0533b1e2d5bec6284d900a9a82632ce782320a19db8b9e0",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.17.0.0/16"
}
]
},
Verified problem exists in 1.11.2
, 1.12.0
and in current master (1.13.0
).
Given the IPAM.Config
filed currently used to carry both configuration and operational data, the gateway address should always be there.
Note: A daemon reload will fix the issue
About this issue
- Original URL
- State: open
- Created 8 years ago
- Reactions: 3
- Comments: 16 (4 by maintainers)
Links to this issue
Commits related to this issue
- [FIX] runbot: find docker gateway for build smtp host When a build is running, the stmp is the localhost. Since Docker builds, the localhost is the container which does not catch port 25 smtp. Mails ... — committed to odoo/runbot by d-fence 5 years ago
- [FIX] runbot: find docker gateway for build smtp host When a build is running, the stmp is the localhost. Since Docker builds, the localhost is the container which does not catch port 25 smtp. Mails ... — committed to odoo/runbot by d-fence 5 years ago
- workaround for https://github.com/moby/moby/issues/26799 — committed to overnode-org/overnode by avkonst 4 years ago
- [calc] work around the docker bridge network issue (#4433) What is the motivation for this PR? There is a docker bridge network issue that would randomly cause "docker inspect bridge" to not show 'G... — committed to sonic-net/sonic-mgmt by yxieca 3 years ago
- [calc] work around the docker bridge network issue (#4433) What is the motivation for this PR? There is a docker bridge network issue that would randomly cause "docker inspect bridge" to not show 'Ga... — committed to 119064273/sonic-mgmt by yxieca 3 years ago
I have seen this now with the latest docker. I am surprised it is nearly 4 years old issue.
The same issue on Ubuntu 16.04 LTS with Docker version 18.06.1-ce, build e68fc7a.
It’s fixed after run commands below:
This issue is still present in Docker 19.03.2 on Linux. Is there any way to solve this without restarting the service on first run?
have the same issue
Getting this on Debian Buster,
docker version Client: Docker Engine - Community Version: 19.03.8 API version: 1.40 Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:25:56 2020 OS/Arch: linux/amd64 Experimental: false
Server: Docker Engine - Community Engine: Version: 19.03.8 API version: 1.40 (minimum version 1.12) Go version: go1.12.17 Git commit: afacb8b7f0 Built: Wed Mar 11 01:24:28 2020 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.2.13 GitCommit: 7ad184331fa3e55e52b890ea95e65ba581ae3429 runc: Version: 1.0.0-rc10 GitCommit: dc9208a3303feef5b3839f4323d9beb36df0a9dd docker-init: Version: 0.18.0 GitCommit: fec3683
After investiguig a little bit, its looks like everything is registered properly, I can look in the file /var/lib/docker/network/file/local-kv.db and I see a json with looks like the expected value from the docker network inspect. Are you just missing a lookup in the database ?
I am seeing this same issue in Docker in Docker. TestContainers depends on their being a gateway defined, and can’t route traffic correctly when it’s missing. I have to relaunch the docker daemon before running my Testcontainer tests.
Issue is there in
1.11.2
as well, not a regression. Given it won’t be seen after a daemon reload, it might be the reason why it went unnoticed for so long.