docker run 7c7d0ce1769d --restart=on-failure -v gerrit_home:/mnt/p_data/gerrit
docker update --restart unless-stopped -v gerrit_home:/mnt/p_data/gerrit 7c7d0ce1769d
docker ps output for the container:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS
7c7d0ce1769d gerritcodereview/gerrit “/entrypoint.sh” 2 months ago Up 4 weeks 0.0.0.0:29418->29418/tcp, :::29418->29418/tcp, 0.0.0.0:8081->8080/tcp, :::8081->8080/tcp ddn-gerrit-1
docker inspect shows it connected to ddn-container-network and ddn_default:
“Networks”: {
“ddn-container-network”: {
“IPAMConfig”: {},
“Links”: null,
“Aliases”: [
“7c7d0ce1769d”
],
“NetworkID”: “568a53fcb7a76e90659817687b24b059598944f42d0f3426226e4265fdb6e299”,
“EndpointID”: “7da88baaf2f101db04ab2a779bc94b6e0ffe805e590c3e22737b6692ce46f144”,
“Gateway”: “172.20.0.1”,
“IPAddress”: “172.20.0.2”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“MacAddress”: “02:42:ac:14:00:02”,
“DriverOpts”: {}
},
“ddn_default”: {
“IPAMConfig”: null,
“Links”: null,
“Aliases”: [
“dkr-gerrit-1”,
“gerrit”,
“7c7d0ce1769d”
],
“NetworkID”: “eb41d1ddfcb88fe97e79ebceffcb4ac5c3ae0522f7f563d63283f974c44c0100”,
“EndpointID”: “9969350a411e5ef4dfc28c32004ca51140f6f456971d35aed4d150ff994e3506”,
“Gateway”: “172.24.0.1”,
“IPAddress”: “172.24.0.2”,
“IPPrefixLen”: 16,
“IPv6Gateway”: “”,
“GlobalIPv6Address”: “”,
“GlobalIPv6PrefixLen”: 0,
“MacAddress”: “02:42:ac:18:00:02”,
“DriverOpts”: null
}
}
docker network
I see these docker networks and the two, dkr-gerrit-1 and ddn_default, that gerrit is connected to is shown but I am not sure why neither one of them is internet aware?
ddn@cos-docker-01:~$ docker network ls
NETWORK ID NAME DRIVER SCOPE
ab6750d1527e bridge bridge local
568a53fcb7a7 ddn-container-network bridge local
eb41d1ddfcb8 ddn_default bridge local
d0eb62c8bb61 host host local
4952eb326396 mysqlnet bridge local
0c20175efcc9 netbox-docker_default bridge local
072eeab8845f none null local
docker inspect of ddn-container-network.
ddn@cos-docker-01:~$ docker inspect 568a53fcb7a7
[
{
“Name”: “ddn-container-network”,
“Id”: “568a53fcb7a76e90659817687b24b059598944f42d0f3426226e4265fdb6e299”,
“Created”: “2023-03-22T16:35:40.777700234-06:00”,
“Scope”: “local”,
“Driver”: “bridge”,
“EnableIPv6”: false,
“IPAM”: {
“Driver”: “default”,
“Options”: {},
“Config”: [
{
“Subnet”: “172.20.0.0/16”,
“Gateway”: “172.20.0.1”
}
]
},
“Internal”: false,
“Attachable”: false,
“Ingress”: false,
“ConfigFrom”: {
“Network”: “”
},
“ConfigOnly”: false,
“Containers”: {
“7c7d0ce1769d828a6fb669e490cc54bc1bd48166980ea07b1b0e09d6a105baaa”: {
“Name”: “dkr-gerrit-1”,
“EndpointID”: “7da88baaf2f101db04ab2a779bc94b6e0ffe805e590c3e22737b6692ce46f144”,
“MacAddress”: “02:42:ac:14:00:02”,
“IPv4Address”: “172.20.0.2/16”,
“IPv6Address”: “”
},
“c81567f79c14017d410cb4f348d87a2ccff9c80399e0b228b37f87d90f146b01”: {
“Name”: “dkr-jenkins-1”,
“EndpointID”: “2f67a4e50cc67215d88fd8ae85c8c08aae50205fac24c34d402591125411c16d”,
“MacAddress”: “02:42:ac:14:00:03”,
“IPv4Address”: “172.20.0.3/16”,
“IPv6Address”: “”
}
},
“Options”: {},
“Labels”: {}
}
]
ddn@cos-docker-01:~$
docker inspect of ddn_default
ddn@cos-docker-01:~$ docker inspect eb41d1ddfcb8
[
{
“Name”: “ddn_default”,
“Id”: “eb41d1ddfcb88fe97e79ebceffcb4ac5c3ae0522f7f563d63283f974c44c0100”,
“Created”: “2023-08-28T15:39:43.041736742-06:00”,
“Scope”: “local”,
“Driver”: “bridge”,
“EnableIPv6”: false,
“IPAM”: {
“Driver”: “default”,
“Options”: null,
“Config”: [
{
“Subnet”: “172.24.0.0/16”,
“Gateway”: “172.24.0.1”
}
]
},
“Internal”: false,
“Attachable”: false,
“Ingress”: false,
“ConfigFrom”: {
“Network”: “”
},
“ConfigOnly”: false,
“Containers”: {
“7c7d0ce1769d828a6fb669e490cc54bc1bd48166980ea07b1b0e09d6a105baaa”: {
“Name”: “dkr-gerrit-1”,
“EndpointID”: “9969350a411e5ef4dfc28c32004ca51140f6f456971d35aed4d150ff994e3506”,
“MacAddress”: “02:42:ac:18:00:02”,
“IPv4Address”: “172.24.0.2/16”,
“IPv6Address”: “”
}
},
“Options”: {},
“Labels”: {
“com.docker.compose.network”: “default”,
“com.docker.compose.project”: “ddn”,
“com.docker.compose.version”: “2.20.3”
}
}
]
ddn@cos-docker-01:~$
Docker inspect of bridge network
ddn@cos-docker-01:~$ docker inspect ab6750d1527e
[
{
“Name”: “bridge”,
“Id”: “ab6750d1527ea4a8d483495cb1be3ff8b0b3d8c8d5e3aefa3176d9bfee50aac0”,
“Created”: “2023-10-17T18:14:29.728169595-06:00”,
“Scope”: “local”,
“Driver”: “bridge”,
“EnableIPv6”: false,
“IPAM”: {
“Driver”: “default”,
“Options”: null,
“Config”: [
{
“Subnet”: “172.17.0.0/16”,
“Gateway”: “172.17.0.1”
}
]
},
“Internal”: false,
“Attachable”: false,
“Ingress”: false,
“ConfigFrom”: {
“Network”: “”
},
“ConfigOnly”: false,
“Containers”: {
“1106cfb91aea7f5465cecc143ab42fdfe131cf6ab7162e375258f8a0408ee47a”: {
“Name”: “registry”,
“EndpointID”: “bfa20c1f0841320855deba81546f5d571b4c126789d9c1989910dc5e8e930b50”,
“MacAddress”: “02:42:ac:11:00:04”,
“IPv4Address”: “172.17.0.4/16”,
“IPv6Address”: “”
},
“89f2f75d0e342e0dce89032132f3886b1acbfbf1e568b41fc35b7844d857aa86”: {
“Name”: “docker-agent-alpine-000l12rd133w1”,
“EndpointID”: “41c96745f7f62e2832d66c72cb45eb8417c54d59dcdc86aa993a896b04993fc7”,
“MacAddress”: “02:42:ac:11:00:02”,
“IPv4Address”: “172.17.0.2/16”,
“IPv6Address”: “”
},
“a85b3a03030db67dfda533d17dee25810995acd012bcc672b1a0f3a7b163b155”: {
“Name”: “analyzer”,
“EndpointID”: “0db6b0142ead0bb92f54633c751c95edbb4e7960b3a0f3f95552da92b3533b73”,
“MacAddress”: “02:42:ac:11:00:03”,
“IPv4Address”: “172.17.0.3/16”,
“IPv6Address”: “”
}
},
“Options”: {
“com.docker.network.bridge.default_bridge”: “true”,
“com.docker.network.bridge.enable_icc”: “true”,
“com.docker.network.bridge.enable_ip_masquerade”: “true”,
“com.docker.network.bridge.host_binding_ipv4”: “0.0.0.0”,
“com.docker.network.bridge.name”: “docker0”,
“com.docker.network.driver.mtu”: “1500”
},
“Labels”: {}
}
]
ddn@cos-docker-01:~$
I would like the ddn-container-network to be internet aware but not sure how to set it up so all containers connected to the ddn-container-network can see the internet.
I would assume the gateway (10.36.16.1) needs set on the ddn-container-network somehow and that the containers attached would need some tweaking as well but not sure how to do that either.
Also, these containers are /16 while my physical network is /20 so I’m not sure how that plays into this.
Thanks for any assistance.
Chuck Forry