Docker: Filesystem is not responding - docker
I have to run 43 containers on the local machine.
Each startup I have warnings
WARNING: Connection pool is full, discarding connection: localhost
Warning don't block my work
But sometimes at containers startup, I got multiple errors below
Filesystem is not responding
Filesystem mounted at /var/lib/docker/overlay/{hash}/merged is not responding
A lot of them pushed as notifications in my manjaro KDE
These errors block my work, containers not working. Only reboot helps me.
I will provide any additional information you need
Filesystem is ext4
Storage driver: overlay2
docker system df
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 16 10 3.82GB 1.198GB (31%)
Containers 43 43 1.138MB 0B (0%)
Local Volumes 20 10 1.947GB 955.4MB (49%)
Build Cache 0 0 0B 0B
sudo docker network ls
NETWORK ID NAME DRIVER SCOPE
3e046a2f4038 bridge bridge local
8aadcba2673b dev_default bridge local
0f58cf29be50 host host local
dace3c787c02 none null local
sudo docker network inspect dev_default
[
{
"Name": "dev_default",
"Id": "8aadcba2673b48477a439252f9528493511d63d017acbe7981893e9abc8ef1ce",
"Created": "2020-02-14T13:40:06.643398755+03:00",
"Scope": "local",
"Driver": "bridge",
"EnableIPv6": false,
"IPAM": {
"Driver": "default",
"Options": null,
"Config": [
{
"Subnet": "172.20.0.0/16",
"Gateway": "172.20.0.1"
}
]
},
"Internal": false,
"Attachable": false,
"Ingress": false,
"ConfigFrom": {
"Network": ""
},
"ConfigOnly": false,
"Containers": {
"016e0d8ec547831d3cb4ed971ccc9d4dd7c21d7bbd17d2295d9b6c2f37250ce1": {
"Name": "dev_emulator-22800014_1",
"EndpointID": "4d665c749b325820aac33d415baa8467e49b549c928d730b0fd16a01423f94c9",
"MacAddress": "02:42:ac:14:00:0a",
"IPv4Address": "172.20.0.10/16",
"IPv6Address": ""
},
"060a555c3a813188d49c06d22170eab6555b4acf6f532bf3c7dd7ea82f01b5fb": {
"Name": "dev_emulator-22800038_1",
"EndpointID": "85a43daca97c55f2ea2c83401468ba64315997f8c817d22fc81a2b54283236dc",
"MacAddress": "02:42:ac:14:00:10",
"IPv4Address": "172.20.0.16/16",
"IPv6Address": ""
},
"06aba1b6a003e42388fd4d4feaa66ab8f2fbab853bf32bf74ef50050cba30ae6": {
"Name": "dev_emulator-22800015_1",
"EndpointID": "2541a4e7d05c88ea2a6bccc3280b5eac8437646ed07fa13d6bd00a65aae0331d",
"MacAddress": "02:42:ac:14:00:12",
"IPv4Address": "172.20.0.18/16",
"IPv6Address": ""
},
"085d84226f8aa471ccbf784f7c34be362371d481d7a157ec87538c631c85868a": {
"Name": "dev_emulator-19400017_1",
"EndpointID": "0bef199879d04a55e0916d943cef1e883cf0032a32fc7c6ff6cc71bc2eb5d397",
"MacAddress": "02:42:ac:14:00:15",
"IPv4Address": "172.20.0.21/16",
"IPv6Address": ""
},
"09fbe0b08f81f1b30a056bcddbf02bafe50f5367447eea52393d6f85fe9e6e95": {
"Name": "dev_emulator-19400019_1",
"EndpointID": "0ab5142fa4f578b23600e0a1b00433009368a82efad15cb7b29273095b4ddb81",
"MacAddress": "02:42:ac:14:00:20",
"IPv4Address": "172.20.0.32/16",
"IPv6Address": ""
},
"160f645c05d1a7ca3c7189a24cbd1aa598ae64a0eced259580e5475544556e99": {
"Name": "dev_emulator-22800016_1",
"EndpointID": "3b376a61b5bd383b4ac92ad959bce1d51fa8f189bb8dc54c086ad0e7ad0c0ee3",
"MacAddress": "02:42:ac:14:00:02",
"IPv4Address": "172.20.0.2/16",
"IPv6Address": ""
},
"18d5f68d2f5d5fc2d39ecad9d16bdb75af91d74626ac77c559fd508c2e75e1e8": {
"Name": "dev_emulator-19400031_1",
"EndpointID": "771bb76578e24aba74f4780b5e3f02d7aa03bd1e6c6b0311ca8a4e66fcd00ea3",
"MacAddress": "02:42:ac:14:00:16",
"IPv4Address": "172.20.0.22/16",
"IPv6Address": ""
},
"23c427c2b75f27b79f2fe83eb9d361d506786fc2f702d5b854d443d14683b0da": {
"Name": "dev_tdiRelay_1",
"EndpointID": "00331149f91abef709e1eb494a937cbe534ef4bfa5da137edb648e748ff800e0",
"MacAddress": "02:42:ac:14:00:2b",
"IPv4Address": "172.20.0.43/16",
"IPv6Address": ""
},
"272c718eaa25a45952eceb860d875418b6ba6a68db026733052e67b7efa3ab8d": {
"Name": "dev_tdiParser_1",
"EndpointID": "02fecfde12e183c6ece57f1ab96b858fb4e3b0f1977a47a00f61ce9ece7960fa",
"MacAddress": "02:42:ac:14:00:2c",
"IPv4Address": "172.20.0.44/16",
"IPv6Address": ""
},
"29e9a0e3fa9eff5185fc6dda092f4358140c4ca852d97f31c31c77055b1ffe60": {
"Name": "dev_emulator-19400013_1",
"EndpointID": "4a501dcf83ba64273512a5381c562abbdc5dba0d0b6d01fe68a03499674e2f15",
"MacAddress": "02:42:ac:14:00:0f",
"IPv4Address": "172.20.0.15/16",
"IPv6Address": ""
},
"2cb4e8011fa4c338803f546dfb9181936030cae6d3d4eddddd7af0a04137f2b6": {
"Name": "dev_emulator-22800010_1",
"EndpointID": "0dc1d7639077e18c511b75638f9995e5a052914da6e14bca174fd6a8217ca2d4",
"MacAddress": "02:42:ac:14:00:17",
"IPv4Address": "172.20.0.23/16",
"IPv6Address": ""
},
"408a7b4f1f1c92be7022f514775ebc93fd6359237b74704da73ee51b158cbfe2": {
"Name": "dev_emulator-22800031_1",
"EndpointID": "380cfac2b1200c530d5c665b5290d8930448ed39c56710d29fe191af5e748d7d",
"MacAddress": "02:42:ac:14:00:0d",
"IPv4Address": "172.20.0.13/16",
"IPv6Address": ""
},
"43bda6ed5698b59d90fa1479547efa2c4bbcec187b03d4990632217bbb4cec9c": {
"Name": "dev_emulator-22800018_1",
"EndpointID": "c77dac271dedc5d05968a17fbf665358ba214d03a67dca082c37668410d0f1a2",
"MacAddress": "02:42:ac:14:00:18",
"IPv4Address": "172.20.0.24/16",
"IPv6Address": ""
},
"44a1e95f87f1eac91bfc06a16a32b8b478df871af9b9d1d9bf095e6f2b075e5a": {
"Name": "dev_maintempdb_1",
"EndpointID": "4021ea4e27729adeaa81b7d0bd6f7c67be17734c4d67b14d660880f7c0531f37",
"MacAddress": "02:42:ac:14:00:05",
"IPv4Address": "172.20.0.5/16",
"IPv6Address": ""
},
"554f1a422ece3eb0558a747ef6d63dba6b0e9d019c438d118ded9ff76ef176df": {
"Name": "dev_emulator-19400040_1",
"EndpointID": "f2a3bb793ab5be3e7c1276d38b3ad3a922ea0a901fa990e356a722875aa1556a",
"MacAddress": "02:42:ac:14:00:14",
"IPv4Address": "172.20.0.20/16",
"IPv6Address": ""
},
"5932a2cb3803e390ce98ef823610e6f3ca12213e52b9812c2d4b5519b473e709": {
"Name": "dev_emulator-22800023_1",
"EndpointID": "81b45bb2b1832a83dab9dfc803e44a724ffd5a6a1bc6e11fc4577b6489b090ed",
"MacAddress": "02:42:ac:14:00:04",
"IPv4Address": "172.20.0.4/16",
"IPv6Address": ""
},
"596314ba1bebbb5938735e7559a2cad8a3927a0b222c9a42f6a2abab2184779e": {
"Name": "dev_mainq_1",
"EndpointID": "9bc8505918c5bef6132172e90c5b50e4801a213e5fb7f18c54f8a841e0deee26",
"MacAddress": "02:42:ac:14:00:22",
"IPv4Address": "172.20.0.34/16",
"IPv6Address": ""
},
"61dea1acffa8eb3508bbf4c90d17fc01b32c7da578682555343d053ca65add04": {
"Name": "dev_outerdb_1",
"EndpointID": "4613444ab9c6e33dc6eb35ff0d5400a8d34b1ceeb30d8e1bb2f607ec9fb953db",
"MacAddress": "02:42:ac:14:00:23",
"IPv4Address": "172.20.0.35/16",
"IPv6Address": ""
},
"666aa5be6401cd4ac2fe34a74789e0a5e210c46fc43a569448f6f51cc255fa61": {
"Name": "dev_outerOctave_1",
"EndpointID": "fc3c5b47a330a68e7b0ff494f1fde3926b429158a1846197d31b11b0aae083cd",
"MacAddress": "02:42:ac:14:00:29",
"IPv4Address": "172.20.0.41/16",
"IPv6Address": ""
},
"6f3533a85093ddde99cac38201ab379bbba2948f08da50a4a173be982cea7c2a": {
"Name": "dev_emulator-22800040_1",
"EndpointID": "9615b87b9cea2f94ba46b0005d4b73c31cf358446cf3bf3ec94894a25a12241a",
"MacAddress": "02:42:ac:14:00:0e",
"IPv4Address": "172.20.0.14/16",
"IPv6Address": ""
},
"7100bd89110864bc254023ffb53bab12883897c42ba7cd5adb29a8b894150f20": {
"Name": "dev_emulator-22800033_1",
"EndpointID": "2bb75565256cb335c1f076e2e4ef4acc5623e0d0bdf4aa1b7c0514fa4eb04f51",
"MacAddress": "02:42:ac:14:00:09",
"IPv4Address": "172.20.0.9/16",
"IPv6Address": ""
},
"801f8d9ddeebf4c1e5f692797cdd65650cd09e05b23eab4e7886cc183c79b6c3": {
"Name": "dev_emulator-19400016_1",
"EndpointID": "e0b0f28260a5a03c79b7f41f1bf8db9640848c6d0aed35d6fdd53cba03d61366",
"MacAddress": "02:42:ac:14:00:0b",
"IPv4Address": "172.20.0.11/16",
"IPv6Address": ""
},
"809d22241a480f9192f29edc5d03e79db33043cc9bfa763639e67e8cfdd80f0e": {
"Name": "dev_emulator-19400015_1",
"EndpointID": "638e6b1cddd1fe78a11de8622ab42ca8ee967303330277e2187261b426aa2f8b",
"MacAddress": "02:42:ac:14:00:1e",
"IPv4Address": "172.20.0.30/16",
"IPv6Address": ""
},
"86995a099365f63f6112c25e3e784f6610ae278702c812b61370e186ca53e2ad": {
"Name": "dev_s3storage_1",
"EndpointID": "e4c8299d772eaa6a57a63bd351585ec5785c09f6df2e785730ae41d4ff3a25f2",
"MacAddress": "02:42:ac:14:00:19",
"IPv4Address": "172.20.0.25/16",
"IPv6Address": ""
},
"8b8e754c99ff6226e8ccd03a150173dfb06e6309c9774c263ae006d9f53f52aa": {
"Name": "dev_emulator-22800022_1",
"EndpointID": "dbd31d8e3150192e87b8917927d07729e0603f5288dcc9f296650f34f06c37ee",
"MacAddress": "02:42:ac:14:00:1c",
"IPv4Address": "172.20.0.28/16",
"IPv6Address": ""
},
"8cf73e2e2503e52bfcafbc1c9322b994127df20c359ca624be644210abd57dbc": {
"Name": "dev_tileserver_1",
"EndpointID": "77374f4cde143d455c0f062e673008c8b41fe4b2977392c9982bc0052217c6c3",
"MacAddress": "02:42:ac:14:00:03",
"IPv4Address": "172.20.0.3/16",
"IPv6Address": ""
},
"8e05504ce48d890fa9359938c533b4495814e67f36c8c5b24a736812a5eb0e2f": {
"Name": "dev_emulator-19400028_1",
"EndpointID": "9d26d053da0d0945d3ff707bccba3cbb12fb81f295678c3604ad60eb9aa9ef2c",
"MacAddress": "02:42:ac:14:00:1f",
"IPv4Address": "172.20.0.31/16",
"IPv6Address": ""
},
"968b41556187c66cb31e623b063d3acf594eb6abac0aa5444bc85d017a807ba6": {
"Name": "dev_outerWeb_1",
"EndpointID": "1959455650da340d1d59f8d6011b88657371d7e7e2db02db69462b6747835f97",
"MacAddress": "02:42:ac:14:00:28",
"IPv4Address": "172.20.0.40/16",
"IPv6Address": ""
},
"9a12736c89c8005b32ff9f11283dfbd666ad201fbd9a45bb1c5ad0f20b5f52eb": {
"Name": "dev_emulator-19400011_1",
"EndpointID": "c23c6ac83769cf06ccc856a47aa0859a9da3f942e7e792384842dde54564e463",
"MacAddress": "02:42:ac:14:00:25",
"IPv4Address": "172.20.0.37/16",
"IPv6Address": ""
},
"9d12ef78d15fec44b4fa42878c4268d1ec4ac21db4f694bc02d208acd1b561df": {
"Name": "dev_emulator-19400012_1",
"EndpointID": "e0f1c3f68bdfa4e7205b6ea8acad4ec791393139e54fc823b9cc7e079c2e419a",
"MacAddress": "02:42:ac:14:00:07",
"IPv4Address": "172.20.0.7/16",
"IPv6Address": ""
},
"b2958a80d70e47692c9ac69314b4fd69acc3e18760f644dceb8142d23d046b3a": {
"Name": "dev_emulator-22800007_1",
"EndpointID": "c285a1c6e276ff364bbb72d60ba94eea247aa524d6e9477de8fb92f60b4a8f83",
"MacAddress": "02:42:ac:14:00:0c",
"IPv4Address": "172.20.0.12/16",
"IPv6Address": ""
},
"b7f4d47981571d0970c1db4dc065a1c93186287b50938b1f1e5acc972678735b": {
"Name": "dev_emulator-19400014_1",
"EndpointID": "8625c39b48c0000b79c13b1d1f21ba07ce16b8813cf786a94ceedc8a84cda55d",
"MacAddress": "02:42:ac:14:00:06",
"IPv4Address": "172.20.0.6/16",
"IPv6Address": ""
},
"c08e59d978c478cd6bb8c30b1ff0dc51b10ac10fc616e6fc24d3600391d4b3da": {
"Name": "dev_emulator-19400020_1",
"EndpointID": "1b629f69d2364e39375cd4cb4e42bd5e34332e468b04169a7fcaa167d58f3f19",
"MacAddress": "02:42:ac:14:00:24",
"IPv4Address": "172.20.0.36/16",
"IPv6Address": ""
},
"c84a447df4e5b632e042e567033d243017b6f0ba58f97be1222110d50b1019b3": {
"Name": "dev_emulator-19400023_1",
"EndpointID": "642b31dd4818063828c9889237416aa7b297391fe557530e11959c971278d0dd",
"MacAddress": "02:42:ac:14:00:26",
"IPv4Address": "172.20.0.38/16",
"IPv6Address": ""
},
"ca15d4fee3f45b8d8a7552aaa519563d2b1b8ea13c51c0c0d1cd94765cf94512": {
"Name": "dev_emulator-19400009_1",
"EndpointID": "8a62973b92ad70a6aad08b717c1ff26fd781cd97e341d2d8ed753a2d2294d00e",
"MacAddress": "02:42:ac:14:00:11",
"IPv4Address": "172.20.0.17/16",
"IPv6Address": ""
},
"cb4fd70cdb8dac59bff2c0257224dc1d261df2770b50221132e5a23997afd1d6": {
"Name": "dev_maineternaldb_1",
"EndpointID": "d4cec9ce4110dd188bf7c958b89433d40d436b46f212fbdf35c0dcbcdf0831b9",
"MacAddress": "02:42:ac:14:00:08",
"IPv4Address": "172.20.0.8/16",
"IPv6Address": ""
},
"e4d60f497831a9c38ebf96a2d48aed8bfb26928a2ed76ba2b8e77139c4b832bc": {
"Name": "dev_emulator-22800004_1",
"EndpointID": "61a18f0b561336186ca3bf01a8b3439396f9c76e3ba76b28c7ec355441be2dd9",
"MacAddress": "02:42:ac:14:00:21",
"IPv4Address": "172.20.0.33/16",
"IPv6Address": ""
},
"e79451e6ad59896d21fcd88301ce099917ef96ea3d32a3060cb79978b6421fcf": {
"Name": "dev_emulator-19400036_1",
"EndpointID": "e3303c42d1b0ebac104762b989229773501b3a8e5b5c7059c765543e3031e8b6",
"MacAddress": "02:42:ac:14:00:1a",
"IPv4Address": "172.20.0.26/16",
"IPv6Address": ""
},
"ead3cffd714f12160dde8e35bae0222b521d6264338267edf9c00bbb11b0ebde": {
"Name": "dev_mainOctave_1",
"EndpointID": "e5f4c078e4b1ed13fd52eb5740f38c59760388a8bed6b01549841a649db6fb94",
"MacAddress": "02:42:ac:14:00:2a",
"IPv4Address": "172.20.0.42/16",
"IPv6Address": ""
},
"ec9aeb9218cef0b8176e3713258812dfcfba5baa691b9639e50fe965b5681cea": {
"Name": "dev_outerq_1",
"EndpointID": "69756ebf2b6a1bdceff4f37fe1dad22859983f417bdbe8e4ab82bd23668500fc",
"MacAddress": "02:42:ac:14:00:13",
"IPv4Address": "172.20.0.19/16",
"IPv6Address": ""
},
"f2b86f1ae769358a413c94d6bc7c129e50cdf2a6afe12d86be1e5b85fce6cad7": {
"Name": "dev_web2_1",
"EndpointID": "0efa83f1aaef42831b312582fbd7ac25c202f7650d237ea30c72de01eaffd1a8",
"MacAddress": "02:42:ac:14:00:27",
"IPv4Address": "172.20.0.39/16",
"IPv6Address": ""
},
"f3ed055ec5f6a6bf6ab73b6db24a495e531e2078694ad523723880e9ae7627e7": {
"Name": "dev_emulator-77700000_1",
"EndpointID": "a3ecfc5de45ba1bc0dd491f6dc4052034b077d0e3f717f182751b2a29e42e850",
"MacAddress": "02:42:ac:14:00:1d",
"IPv4Address": "172.20.0.29/16",
"IPv6Address": ""
},
"fca06c99c6f6140161a007bab98e885f468a40a21318f9b7be2fdec322645db9": {
"Name": "dev_maincouchdb_1",
"EndpointID": "45b118cabc4a5ca41a968f3d382045a9a1b62939f0a871cedb64a3f0068a0aec",
"MacAddress": "02:42:ac:14:00:1b",
"IPv4Address": "172.20.0.27/16",
"IPv6Address": ""
}
},
"Options": {},
"Labels": {}
}
]
sudo docker network inspect bridge
[
{
"Name": "bridge",
"Id": "3e046a2f4038ab5cf2c2989c7c7adb2bb2f75cd75fef18d133cc7d6952b8fa72",
"Created": "2020-02-14T13:25:50.571033335+03: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": {},
"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": {}
}
]
sudo docker info
Client:
Debug Mode: false
Server:
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 117
Server Version: 19.03.5-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: false
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host ipvlan macvlan null overlay
Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: d50db0a42053864a270f648048f9a8b4f24eced3.m
runc version: dc9208a3303feef5b3839f4323d9beb36df0a9dd
init version: fec3683
Security Options:
apparmor
seccomp
Profile: default
Kernel Version: 5.5.2-1-MANJARO
Operating System: Manjaro Linux
OSType: linux
Architecture: x86_64
CPUs: 8
Total Memory: 31.33GiB
Name: gemini-f5
ID: EXYX:H5OE:U74F:HHTF:6P4M:B7HJ:YEXR:S34A:PPXJ:W56Z:BI3D:2DXI
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
dockerregistry.smart-dn.ru:5000
127.0.0.0/8
Live Restore Enabled: false
hi we have same problems sometimes when using nfs share volumes,sometimes on filesystem,all depend on how many volumes you have.
Simple answer is docker is not build to start up lots of containers.
Our production server when we make once per mont maintance (rebooting) starting 100 containers somtimes even 1 hour. producing not only filesystem (IO read/write) errors.
Try to find a way to block these
pushed as notifications in my manjaro KDE
containers will eventualy start up
we didnt find any solution
our stable workaround was rancher.com and another servers. Rancher helped in way of self distributing containers to server with low resource usage.
I suspect this has s.th. to do with Python's request library like described in docker-compose restart connection pool full. I suggest to try the solution and search for the setting DEFAULT_POOLSIZE and set it to a higher value.
On my mac this parameter can be found in /usr/local/homebrew/lib/python3.7/site-packages/requests/adapters.py.
This file may of course be overwritten as soon as you update that library however I did not found another way to set this parameter.
Related
Can't use more than 32 Docker containers (networking issues)
I am currently setting up a multi-agent system in Docker, such that each agent is running in a separate container and communicates with the other agents within the Docker network. Everything works fine, if I start less than 32 containers. If I run more than that, the agents are not able to communicate anymore. Further, the network on my host machine behaves strangely and I loose internet connection. The containers themselves start without any issues, though (only communication doesn't work). If I stop all containers, my host machine is connected to the internet again. First, I create a custom Docker network: docker network create --driver bridge agent_network --subnet 10.10.1.0/24 I made sure that the IP range is not used by other services on my machine. Next, I specify the custom network in my docker-compose.yml file which also contains my agents as services: version: "3.8" networks: default: external: true name: agent_network services: agent: ... Finally, I run the system using the command: docker-compose up --build --scale agent=32 agent Such that 32 instances of the agent as defined in the docker-compose.yml file are started. The agents start successfully and there is no error from Docker concerning network issues. Only problem is, the agents don't receive any messages. Does anyone has a solution to this problem? Many answers I found online were considering using the default bridge of Docker and mainpulating the address space. However, this doen't work either in my case and it's recommended to not use the default bridge by the Docker docs. Also editing the /etc/docker/daemon.json file to expand the address space did not work. If it helps, here are some technical details of my system: Host machine OS: Ubuntu 22.04.1 LTS Host machine IP: 192.168.0.34 Docker: 20.10.22 docker-compose: 1.29.2 Update 1: Below is the output of the command docker network inspect agent_network when the containers are running (43 containers were started): [ { "Name": "agent_network", "Id": "7e5a4b6abe02d01144690f62dad120660d11319abd34b3dc62de37ce3f0c2a0e", "Created": "2022-12-22T16:24:58.776012944+01:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": {}, "Config": [ { "Subnet": "10.10.1.0/24" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "03fb10e0d4e0c1b28053ebb80294029f51018a91e84dadb266a8872be45d19ac": { "Name": "docker_iwt_agent_17", "EndpointID": "24c52fab24963827d02fa844f1c15a7b3d8296d9832b5b1f63cac1957a456a67", "MacAddress": "02:42:0a:0a:01:05", "IPv4Address": "10.10.1.5/24", "IPv6Address": "" }, "05c91dabd601118ea8269d77756b69236eddd0d97918633542b5640cbc65738c": { "Name": "docker_iwt_agent_15", "EndpointID": "efc0abf1397e2e55b0496aedfdb4619edaf38213eb8ee952186a5953bdf05d43", "MacAddress": "02:42:0a:0a:01:28", "IPv4Address": "10.10.1.40/24", "IPv6Address": "" }, "09cca2d89486b163314c402efa3e72a13a41e9c046837bec9d1308c63bd8288b": { "Name": "docker_iwt_agent_1", "EndpointID": "565d6010c9919eddfd98a937a532200d2477f87a8f056627f6b2abce8647a98e", "MacAddress": "02:42:0a:0a:01:10", "IPv4Address": "10.10.1.16/24", "IPv6Address": "" }, "0b3f43c0f6d250619c5051a76549f7f2f70014e020cefa4816eabb3adb5fb885": { "Name": "docker_iwt_agent_8", "EndpointID": "10b691061cd220b8dfc030d3641512a9fba3bb9c08b9c4d3514f7f661eaffde2", "MacAddress": "02:42:0a:0a:01:03", "IPv4Address": "10.10.1.3/24", "IPv6Address": "" }, "0b776566285f7be530ea91a4fd2295a459d4e27130e19f8e3181f1bb302ac493": { "Name": "docker_iwt_agent_25", "EndpointID": "cfc21fdee01fdfaba8d7e08f1f8c6e6a520c464b6fca219001119416b51ec906", "MacAddress": "02:42:0a:0a:01:16", "IPv4Address": "10.10.1.22/24", "IPv6Address": "" }, "25b4d77eaf2a249bd516131565621ee41edf85e9cd66ef2950657de88cf80d21": { "Name": "docker_iwt_agent_11", "EndpointID": "203333983f3ec9382da87212e48b3afe4ba890e86c9159b1b58bc94d6e9c3d89", "MacAddress": "02:42:0a:0a:01:0c", "IPv4Address": "10.10.1.12/24", "IPv6Address": "" }, "2654ba6e89d0153e59f2de477a787ab5b3064dd99284949d4db66d6bd659306d": { "Name": "docker_iwt_agent_24", "EndpointID": "89e5db4f584a584272a51cdf9301ff86b0931ae0cda786355829cbe8ac68ecb4", "MacAddress": "02:42:0a:0a:01:1d", "IPv4Address": "10.10.1.29/24", "IPv6Address": "" }, "26a6b5d80abadcf9b27f5606d9e53ef44e25f11bc85dc2c651e8c3034af9b122": { "Name": "docker_iwt_agent_34", "EndpointID": "6c8de526c126eb62fd4f01a21b01a3aba12963ae7e684102babcdf7c32fa7858", "MacAddress": "02:42:0a:0a:01:2b", "IPv4Address": "10.10.1.43/24", "IPv6Address": "" }, "2fda699d23ddf42546eefdc21b22b984f186eee10c9d087958d4fb4303b8a343": { "Name": "docker_iwt_agent_41", "EndpointID": "6410170b70bb49bf83d31c22e7eb3e0c8c8a79063f0705956e8a26683a4ab45b", "MacAddress": "02:42:0a:0a:01:0b", "IPv4Address": "10.10.1.11/24", "IPv6Address": "" }, "38f653bb69ea04d1424b64bacf258f66380c3a276bbd3df50cb45b6f73eae5d5": { "Name": "docker_iwt_agent_20", "EndpointID": "13bd9bba90ceeda0de8e8bdc9d2a075e0f1dba86ff94ff5ab0f7517733ca67c7", "MacAddress": "02:42:0a:0a:01:14", "IPv4Address": "10.10.1.20/24", "IPv6Address": "" }, "473e179b73f32b289435f3e3cbbb7f9a7034635d703fd66f7293893eabfb8802": { "Name": "docker_iwt_agent_22", "EndpointID": "22ce17c3dc719142bfa101d49583a2a0f71e1ec01a19c881621ebe66e8b4e211", "MacAddress": "02:42:0a:0a:01:1f", "IPv4Address": "10.10.1.31/24", "IPv6Address": "" }, "581f91b16bc22949de0e60a85669c909c8748e5438a35b01ad10b8c3d18e5bce": { "Name": "docker_iwt_agent_6", "EndpointID": "b0c5ea84bd9d5e9a642d1b7317e5f8792fe28204bf88bde503273e4df2227b40", "MacAddress": "02:42:0a:0a:01:20", "IPv4Address": "10.10.1.32/24", "IPv6Address": "" }, "58a966dd9478139d34ffa94355fe1daee168d7863cf211423e7f643f9f0b104f": { "Name": "docker_iwt_agent_40", "EndpointID": "f9e4efcc927fb4966d5b54c0210dbcf1f595222a1fb5f0c0607896dbb33d98e6", "MacAddress": "02:42:0a:0a:01:21", "IPv4Address": "10.10.1.33/24", "IPv6Address": "" }, "5f63e021e176fcc714b9c9b4d7579c38467cfe6ef23d97038d2c8ee84c252028": { "Name": "docker_iwt_agent_35", "EndpointID": "c3be1cd49404b5b60e63a37601e50d09928c7caedc5d4697fac862fa4fc9d50b", "MacAddress": "02:42:0a:0a:01:0e", "IPv4Address": "10.10.1.14/24", "IPv6Address": "" }, "6038fa2517624496e7fb5248841f5e1d28c22173ffeba9c1124ef4177e7761ed": { "Name": "docker_iwt_agent_21", "EndpointID": "b45812055779b2fc56e5a6c9765fef05b374089b626725f6e1f915661179d10c", "MacAddress": "02:42:0a:0a:01:29", "IPv4Address": "10.10.1.41/24", "IPv6Address": "" }, "62f24f4a5c3ad9dbd8b604c4eb6d5a0e8fd8ce539008a486e71c4d6716cfd976": { "Name": "docker_iwt_agent_13", "EndpointID": "7bc2201c2a9b602d708e609882b5c6bfbbae7df0db9a341f4633deae6d37ab42", "MacAddress": "02:42:0a:0a:01:0f", "IPv4Address": "10.10.1.15/24", "IPv6Address": "" }, "6a2a81660b72e3138ccddbfc70e8c907196217f7d5e5985e241eeb38a759477d": { "Name": "docker_iwt_agent_16", "EndpointID": "266df1ee74cca9e26dbe19350feff84530e37324001495c029058fffe63cceb3", "MacAddress": "02:42:0a:0a:01:12", "IPv4Address": "10.10.1.18/24", "IPv6Address": "" }, "6aea9c53022d5155d05f8013091d001187afa968fb04e0d1ab0d987371b1f1ce": { "Name": "docker_iwt_agent_43", "EndpointID": "90b1e7e4ff057207d6ad11b1d0e46793f9b849c953508c02cfbb2b9cf5b52c56", "MacAddress": "02:42:0a:0a:01:19", "IPv4Address": "10.10.1.25/24", "IPv6Address": "" }, "6e4847a8d50745a7b9bad71691367379c09e6cce8ee8117fffff0be19cb8c97f": { "Name": "docker_iwt_agent_31", "EndpointID": "8c5630ca5d6697140b316b0ab8e92c98eb707612eefa29002fae077525d6ac6a", "MacAddress": "02:42:0a:0a:01:18", "IPv4Address": "10.10.1.24/24", "IPv6Address": "" }, "80aa000edc914d7ea8d9bbc3288eb5e61e1c200643b043deff704c4d7b6ccdaf": { "Name": "docker_iwt_agent_2", "EndpointID": "a3e6fb766d3ed3b23b7447d0524a791e8b70e2e8c558f9f3be46d6e2ee35e050", "MacAddress": "02:42:0a:0a:01:04", "IPv4Address": "10.10.1.4/24", "IPv6Address": "" }, "85ef36d28f6decbb58f8140fc78f96dc33acf39142f00224baaa0bdede26b77a": { "Name": "docker_iwt_agent_12", "EndpointID": "35a6e014b1231f5f5b9eece616543f600d41a40036a50e373617e7801bf42593", "MacAddress": "02:42:0a:0a:01:27", "IPv4Address": "10.10.1.39/24", "IPv6Address": "" }, "876e22b8982b85eca3e4d3e4f1e621b206f74258d122c0f80586fa4e8e71e825": { "Name": "docker_iwt_agent_14", "EndpointID": "df91e7a3901cd70b644deb51ad25ca75106b2bfc109d9285978d5058c8d7de45", "MacAddress": "02:42:0a:0a:01:09", "IPv4Address": "10.10.1.9/24", "IPv6Address": "" }, "8bc187fd30125562970e9cd20ce3b79f55cb4a251a79683140b792ee2aa26437": { "Name": "docker_iwt_agent_42", "EndpointID": "e991d3aae99c93d4fb2475613f033ef020062c81696f07f3d032846baa646008", "MacAddress": "02:42:0a:0a:01:2a", "IPv4Address": "10.10.1.42/24", "IPv6Address": "" }, "934a0cc93ef080ee70a26cc168916e39bfd060d3edaa32a795599ba6b9520c32": { "Name": "docker_iwt_agent_33", "EndpointID": "f77ae0a71c0b92d2050546db3effc5f40781ff68b78d6efa5380114ae4205bce", "MacAddress": "02:42:0a:0a:01:1c", "IPv4Address": "10.10.1.28/24", "IPv6Address": "" }, "9c1194fe4c17087b9459674625269bb648539832f72a9bd9eb8ec295938bda6a": { "Name": "docker_iwt_agent_5", "EndpointID": "6e9a9dcf41b252f0895a1137928c82a8c1848718c4f1a05165b1f4f571f7db58", "MacAddress": "02:42:0a:0a:01:06", "IPv4Address": "10.10.1.6/24", "IPv6Address": "" }, "9cf86420156e6cb7a897e22ddba47be3e2a03e56fb508bc224c8c7086c534f4f": { "Name": "docker_iwt_agent_10", "EndpointID": "39b52cb28ff118b2b66ea6b10a40ae2a09f30d9a0a335352c8520dad257d4d5b", "MacAddress": "02:42:0a:0a:01:17", "IPv4Address": "10.10.1.23/24", "IPv6Address": "" }, "9d8a52bb6ccc127d59deb410510c8daf9dbe0b8390b95f9df88f77a5f4531227": { "Name": "docker_iwt_agent_29", "EndpointID": "74a37f1cda8d866d31307b9724de8b20c3586369b595004a646f57afcbdfc81b", "MacAddress": "02:42:0a:0a:01:0a", "IPv4Address": "10.10.1.10/24", "IPv6Address": "" }, "b0f08db9efc2f8fdede0c217131f4d9057b90b4bd9e46de4a0ca05cb303c6775": { "Name": "docker_iwt_agent_19", "EndpointID": "937a75187cf7769ea3dfdfcdb6784cca20074e3678c9d11595c2b06900b48991", "MacAddress": "02:42:0a:0a:01:15", "IPv4Address": "10.10.1.21/24", "IPv6Address": "" }, "b39034c21095449ca11005dc39dd6e6e01136626ab6505cd87838916b593125c": { "Name": "docker_iwt_agent_30", "EndpointID": "38176fb2110c43a65c9ab0e1980d2736dc8d51db7ae812b7b84f0d098cd7bc9a", "MacAddress": "02:42:0a:0a:01:23", "IPv4Address": "10.10.1.35/24", "IPv6Address": "" }, "b4a6e4b193df0db681e5d4e80c9e6d8c460419282a5925609a8bfc49e6da546b": { "Name": "docker_iwt_agent_3", "EndpointID": "2bd0b5e20bd4bf47e28a5bdb3151d065f7df7146d0a9c4c675076538de2a4445", "MacAddress": "02:42:0a:0a:01:26", "IPv4Address": "10.10.1.38/24", "IPv6Address": "" }, "baf7691f3aabaac9198bb152237ae40848cc3ec71bfd5c839d1bacded09839e5": { "Name": "docker_iwt_agent_23", "EndpointID": "e942e0d9f9e3d1849e3b43e316acc817eaacb9cdeab9b5c27fd2275aac10abef", "MacAddress": "02:42:0a:0a:01:02", "IPv4Address": "10.10.1.2/24", "IPv6Address": "" }, "c0810b6fb6f06a33971c132069fc5b15b0191762b5f9f2915da641e02212c481": { "Name": "docker_iwt_agent_39", "EndpointID": "b9da33c0858803fa3cf09c0a33410539046a8d0add3dbe5c8426db4599d9c8e6", "MacAddress": "02:42:0a:0a:01:25", "IPv4Address": "10.10.1.37/24", "IPv6Address": "" }, "c11c0e1d6c19b58fcb655bd421167fbc52ba046962f4c42397a6cb7d52a0b043": { "Name": "docker_iwt_agent_9", "EndpointID": "883f51cfdc72a9f5b5765038936853c3126fc9c20c597fe4db0378123569fa0f", "MacAddress": "02:42:0a:0a:01:1a", "IPv4Address": "10.10.1.26/24", "IPv6Address": "" }, "c32fc4209a75d4a17b8043007c7bc5f1ff19b8df6e0d5bf4dc779c0f9fb96d25": { "Name": "docker_iwt_agent_37", "EndpointID": "e0e03869ec48c5467eb7bd8c65ac115ca7948a3b20b440337482612a914d37b4", "MacAddress": "02:42:0a:0a:01:22", "IPv4Address": "10.10.1.34/24", "IPv6Address": "" }, "d5cf8cef442b85694dd73f74835dc6711bdff64e7e32ca43733cbe9e2b0a3017": { "Name": "docker_iwt_agent_28", "EndpointID": "899e7cf06e2965f5a899ac39ea599fd8e755f0d3c4e2f493fae6e0183ab03f0b", "MacAddress": "02:42:0a:0a:01:1b", "IPv4Address": "10.10.1.27/24", "IPv6Address": "" }, "d9f24bd6d4a6886fcef1368f64c21ebef3e2f99437681d5779f33168038935cc": { "Name": "docker_iwt_agent_26", "EndpointID": "e10cc1b2ce2e4fe15619742a5aab23d12c5dae19c2cbd5203171a3d54627c494", "MacAddress": "02:42:0a:0a:01:08", "IPv4Address": "10.10.1.8/24", "IPv6Address": "" }, "dd21d43db623ea47a8c2e2d353c6f50213fd478ca446e1bdca7a4b2b29648c57": { "Name": "docker_iwt_agent_38", "EndpointID": "32353ca1e5da0b6ab7f25568db8b0b4267956f0a0485bf0079049e5821ada648", "MacAddress": "02:42:0a:0a:01:11", "IPv4Address": "10.10.1.17/24", "IPv6Address": "" }, "e1a5a45f1842bb7149e15afd4e76aa973f40ec312b882da5629a881d887b4b38": { "Name": "docker_iwt_agent_27", "EndpointID": "7e233de0421931932330c4900bd273e93bc190f76bfd83a1521377cf9fe358f0", "MacAddress": "02:42:0a:0a:01:2c", "IPv4Address": "10.10.1.44/24", "IPv6Address": "" }, "e1b5f8a7a0f68579c8031051005a3ae7753d7fe2992d2c1e632cc7c1049346c3": { "Name": "docker_iwt_agent_32", "EndpointID": "a98a6db3f9bc0c3788eb91330f6f57f4f4373d508427e2b0e285397e8ac5b4ed", "MacAddress": "02:42:0a:0a:01:0d", "IPv4Address": "10.10.1.13/24", "IPv6Address": "" }, "e334302d1694a6458e014b90406a2945e91c43fedbb63566a0e3aa4d0068e60e": { "Name": "docker_iwt_agent_7", "EndpointID": "915f03e069de97948949df5bc2a69187ba54cca000be25921715a605a2611326", "MacAddress": "02:42:0a:0a:01:07", "IPv4Address": "10.10.1.7/24", "IPv6Address": "" }, "ecbac3f6726a40b04b8b874680f78d77cb27a0b462a0d082c053f62ce95f22b7": { "Name": "docker_iwt_agent_18", "EndpointID": "c50600484f96862bd41bcd7749f7e3cabef224778b622e7e3441715bab65c158", "MacAddress": "02:42:0a:0a:01:1e", "IPv4Address": "10.10.1.30/24", "IPv6Address": "" }, "f4f88c8d286072cfce68ef6f119c24f903be9e62e265fa9ef7c99b26f4bdea29": { "Name": "docker_iwt_agent_36", "EndpointID": "ef37ed88c4cac957f9d4794b865024e6be8c1ca8920c82a3bd84a149926d83cc", "MacAddress": "02:42:0a:0a:01:24", "IPv4Address": "10.10.1.36/24", "IPv6Address": "" }, "f9c42de6bb873e9ecc199d6c6799873d40ea45d4b436151c948c447089973ca1": { "Name": "docker_iwt_agent_4", "EndpointID": "9f757b85a87ea2f1fe05e9961feb978e16bc871a42042f7981cbdf12b44d1efb", "MacAddress": "02:42:0a:0a:01:13", "IPv4Address": "10.10.1.19/24", "IPv6Address": "" } }, "Options": {}, "Labels": {} } ] Update 2: Analogously to the proceedings above, I tried to set up the custom Docker network for the use of IPv6. Hence, I create the network using following command: docker network create --driver bridge --subnet=2a01:4f8:a:b:c::/80 --ipv6 agent_network Additionally, I enabled IPv6 in the /etc/docker/daemon.json file as follows: { "ipv6": true, "fixed-cidr-v6": "2a01:4f8:a:b::/64" } However, the same issues as before persist, and even though the output of the command docker network inspect agent_network states that all containers are connected to the Docker network and have uniques IP addresses, there is no communication between the containers. As before, my host network shuts down as well as soon as I start the Docker containers. Still, everything is running perfectly if I start less than 32 containers (also using IPv6).
The build in docker dns function is broken suddently
I alway lookup the services each other by docker name in my system, things like : "curl http://contianer_name". Initially, All things is fine and It has worked for several months, But it is broken yesterday, Nginx could not bypass the url like http://contianer_name, And I could not curl successfully for the http://container_name in my host machine. What it is happen? :(,,, docker network ls: NETWORK ID NAME DRIVER SCOPE ecbfafa9fccf bridge bridge local b1aac67cfbfa myapp-api_default bridge local 5195101110d3 host host local d90ca5db218d none null local docker network inspect [ { "Name": "myapp-api_default", "Id": "b1aac67cfbfa2923d5ae88a26e8729159f34e1ae083944e385a23047a7fc7237", "Created": "2022-09-28T18:21:57.202490009+08:00", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.22.0.0/16", "Gateway": "172.22.0.1" } ] }, "Internal": false, "Attachable": true, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "850c8c091467b7c92aedff5631869ab2f5603ae48ee4a1efb7f18f2f890154ff": { "Name": "app-boot-system-sample", "EndpointID": "1497a7ac8726646f24bf82400d69c56bbcacb689d4423ab54db15af586373179", "MacAddress": "02:42:ac:16:00:05", "IPv4Address": "172.22.0.5/16", "IPv6Address": "" }, "c819074103a5b108d21b836afd1c156036e13f523b44eb5002e13edf48d9f825": { "Name": "sample-tenant-pc", "EndpointID": "d4ef531762a117132cbd40dee729cdf2458061e2444d35fc7968411676329e7b", "MacAddress": "02:42:ac:16:00:04", "IPv4Address": "172.22.0.4/16", "IPv6Address": "" }, "d04e0c550c95da196844c160ca9b9f80f99e3536f92da55d6e9f18533a381802": { "Name": "sample-event-pc", "EndpointID": "71bb31e965df8f47cfcc32685594803496bf77ad396854b5dc57851467f99996", "MacAddress": "02:42:ac:16:00:07", "IPv4Address": "172.22.0.7/16", "IPv6Address": "" }, "ee6589ced2f5080b9f3641104262f430da8f37e1278f094f78a45e2414a607f4": { "Name": "app-boot-redis-sample", "EndpointID": "be41952c5709d7a843b9b2ce3276bd7ac8e951ab653ba478d3a8f7cf7fe9599a", "MacAddress": "02:42:ac:16:00:03", "IPv4Address": "172.22.0.3/16", "IPv6Address": "" }, "fd9196fc0fee67de364d6be37581e4fd9827b2983a332995269af78817828bbd": { "Name": "sample-org-pc", "EndpointID": "a0fd805ee5705533f58b7f0e3f1cbdb0a20abc1a01057bd23a2a5161d0c5181c", "MacAddress": "02:42:ac:16:00:02", "IPv4Address": "172.22.0.2/16", "IPv6Address": "" } }, "Options": {}, "Labels": { "com.docker.compose.network": "myapp-api_default", "com.docker.compose.project": "myapp-api", "com.docker.compose.version": "1.26.2" } } ] Docker compose defined as below in the project sample-tenant-pc: version: '2.4' services: sample-tenant-pc: build: context: . restart: always container_name: sample-tenant-pc image: sample-tenant-pc ports: - 9001:80 networks: - myapp-api_default networks: myapp-api_default: external: false name: myapp-api_default
How can I connect my docker containers on the default bridge network?
I have 2 docker containers running on my windows 10 machine. I have been able to interact with them by binding container ports to host ports, but now I want to dockerize another application that I have been using to interact with these containers. Up until now I have been configuring the urls using localhost, but after moving the third application to a container that will no longer be an option, so I did some research and decided to use the default bridge network. I checked that all 3 containers were in the network: [ { "Name": "bridge", "Id": "c570148be95b87b5bc768de573e85c25fa4584df2c5df5c63b2d317decabe651", "Created": "2021-03-22T07:49:32.2206325Z", "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": { "38beb0863d86dab0f014ef9f1ad85f02efa7fb96520455df6f6ea6b5519f60cc": { "Name": "my_redis", "EndpointID": "58a6cfab6f233ac39c9b043c660124fd9cb98970f99f154ad8b3774a3356e71b", "MacAddress": "02:42:ac:11:00:03", "IPv4Address": "172.17.0.3/16", "IPv6Address": "" }, "70fe60faa0dc3b853edcf2005e16d6219015eafa1c65d48aebd57256ff329f2b": { "Name": "rabbitmq", "EndpointID": "ed4ac901659785eebfd58de4056efd51addd19eda8c184a38632f1486c178e53", "MacAddress": "02:42:ac:11:00:04", "IPv4Address": "172.17.0.4/16", "IPv6Address": "" }, "b34359519bbf0253af3eba8e800a1bcabeb3cfe6e5cc5007679c6f632f1d4820": { "Name": "app", "EndpointID": "3363141459cc7eebeca1651b047ed3af81c4af37c3706dfa74e5eadb6f95f302", "MacAddress": "02:42:ac:11:00:02", "IPv4Address": "172.17.0.2/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": {} } ] From what I can see, icc is enabled and all 3 containers are on the network. I used the IPv4Address in the configuration in app: STA_REDIS_HOST = 172.17.0.3 (with and without the /16 at the end, because I'm not sure what it means), and it seems as if the ip is being resolved to something else, because I get the following error: Error 111 connecting to 127.0.0.1:6379. Connection refused. I don't know where 127.0.0.1 but it looks like the private ip of the host machine. Where am I going wrong here?
I didn't get how you are trying to connecting one container to other... docker_bridge_network demonstrates pinging one container to others by using bridge network
Docker Compose does not create containers in defined subnet
I have a docker-compose file which defines a network subnet: networks: <net-name>: name: my-network driver: bridge ipam: config: - subnet: 172.21.1.0/16 When i run docker-compose up the created containers (all on the same network) are not in this defined subnet, but on the default 172.21.0.X/16, as seen in the docker network inspect <net-name>: "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.21.1.0/16" } ] }, ... "Containers": { "7fe928549faaa7da71a8b75b668ab6b5dae9e337e8abc7c379b3aa685cccf136": { "Name": "container1", "EndpointID": "724c4e86574b72e49afe0729e053d2b7c7285ec07e350f1efb8a3dff9b9f2d22", "MacAddress": "02:42:ac:15:00:02", "IPv4Address": "172.21.0.2/16", "IPv6Address": "" }, "ead40f068d7a4b657c09fb583bdcc229cd2cda2e46876c0bdc602388f19a15bb": { "Name": "container2", "EndpointID": "7759ba9bea74496278f74780c49d94e035d1e9c8c330837ea81e95b4d7485da0", "MacAddress": "02:42:ac:15:00:03", "IPv4Address": "172.21.0.3/16", "IPv6Address": "" }, "f4c18290c832705d83840108c38769b27f418a2845e92aebcd2afc920c519a95": { "Name": "container3", "EndpointID": "7ca9be45cea2f5833ea5f673acccce08721e0bf6fff581dad70da7143bb19e03", "MacAddress": "02:42:ac:15:00:04", "IPv4Address": "172.21.0.4/16", "IPv6Address": "" } }, The reason this is a problem for me, is that internally in the containers I listen for specific IP adresses, and not everywhere can I use docker DNS resolution. I also have two compose services, which are separated by these subnets, one on 172.21.0.0/16 and the other on 172.21.1.0/16 How can I enforce compose containers to be created on the compose network subnet?
What IP address to use to connect to container in network?
[ { "Name": "composer_default", "Id": "1b06e8bd3c547c739285284f89d416b6bae6cad8d8a5437659cc2877136c5e8f", "Created": "2018-05-25T06:42:35.269643488Z", "Scope": "local", "Driver": "bridge", "EnableIPv6": false, "IPAM": { "Driver": "default", "Options": null, "Config": [ { "Subnet": "172.18.0.0/16", "Gateway": "172.18.0.1" } ] }, "Internal": false, "Attachable": false, "Ingress": false, "ConfigFrom": { "Network": "" }, "ConfigOnly": false, "Containers": { "1963ad6763c63f3e4dd15b0a4717ddee5c2fe39dad90edbd75c4a0c4f412439b": { "Name": "orderer.example.com", "EndpointID": "a34529bb554dd0a7f3ad706cf95536112774b209619364dd98f7edbb5317b150", "MacAddress": "02:42:ac:12:00:03", "IPv4Address": "172.18.0.3/16", "IPv6Address": "" }, "46237b2a21b2a2dbb513ccea7e93793538bcdeaf583e82911c2451f7ee109faf": { "Name": "couchdb", "EndpointID": "398a01a0f85cf91ddb23933ded579597263135cbe5b027a73d9bbe374837a06f", "MacAddress": "02:42:ac:12:00:04", "IPv4Address": "172.18.0.4/16", "IPv6Address": "" }, "5baee4bb30d087b0d622954228be91509124f632a81774fb382fe0e80111d32b": { "Name": "ca.org1.example.com", "EndpointID": "a458f59f8d3fa2600f6eb933ee685bffc08ac83cd793ad707f9188b1a07fb6a9", "MacAddress": "02:42:ac:12:00:02", "IPv4Address": "172.18.0.2/16", "IPv6Address": "" }, "651d6d2878104cc496b0bafd6466b70d8a45ef462cc06130e93e0a50214d1f99": { "Name": "peer0.org1.example.com", "EndpointID": "9e9a7c2c3164d6258e5bd3231376772703fe2d621978e0760e44569fc3c8c567", "MacAddress": "02:42:ac:12:00:05", "IPv4Address": "172.18.0.5/16", "IPv6Address": "" }, "da6a8ade513c4fb9b1a351f42e0a06f2e26f0eb471fa08832aa3863285e2f384": { "Name": "dev-peer0.org1.example.com-usps-imts-network-0.0.2", "EndpointID": "0f73549d1c16abb13fe1a2d1a1a175e6161ad3d155064033654a436669468b9e", "MacAddress": "02:42:ac:12:00:06", "IPv4Address": "172.18.0.6/16", "IPv6Address": "" } }, "Options": {}, "Labels": {} } ] I have another Node.js app in a container that I will add to this composer_default network. orderer.example.com is also in this network in its own container. When Node.js app was outside of container, I was previously doing grpc://localhost:7050 to connect. Now that it is in a container, grpc://<WHAT-IP-SHOULD-I-USE>:7050? I tried the container name grpc://orderer.example.com:7050, as well the network gateway grpc://172.18.0.1:7050, and am unable to connect.
Container name or IP should work so http:localhost:7050 => http://orderer.example.com:7050 or http://172.18.0.3:7050. { "name":"hlfv1", "x-type":"hlfv1", "x-commitTimeout":300, "version":"1.0.0", "client":{ "organization":"Org1", "connection":{ "timeout":{ "peer":{ "endorser":"300", "eventHub":"300", "eventReg":"300" }, "orderer":"300" } } }, "channels":{ "composerchannel":{ "orderers":[ "orderer.example.com" ], "peers":{ "peer0.org1.example.com":{ } } } }, "organizations":{ "Org1":{ "mspid":"Org1MSP", "peers":[ "peer0.org1.example.com" ], "certificateAuthorities":[ "ca.org1.example.com" ] } }, "orderers":{ "orderer.example.com":{ "url":"grpc://orderer.example.com:7050" } }, "peers":{ "peer0.org1.example.com":{ "url":"grpc://peer0.org1.example.com:7051", "eventUrl":"grpc://peer0.org1.example.com:7053" } }, "certificateAuthorities":{ "ca.org1.example.com":{ "url":"http://ca.org1.example.com:7054", "caName":"ca.org1.example.com" } } }