docker containers connected to a network when run won't show up in network_object.containers field
See original GitHub issuewhen running a container with
client.containers.run(.....,
network=net1,
......)
the container ends up connected to the network, but when calling net1.containers
on the network object, it returns an empty list ([])
When re-getting the network object with
client.networks.get(net1_name)
,
the container shows up.
to reproduce this bug:
- create a network object with client.networks.create
- run a container with
client.containers.run
, with parameternetwork = (the name of the net you created)
- check
network_object.containers
field and see it’s empty - do
client.networks.get(net1_name)
to re-get the object and see that now the container is present in checked this issue with two different hosts with different docker versions, both reproduced the bug.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Can't connect to other containers inside docker network
I have a few containerized projects I would like to talk to each other into a network called 'dev_network'. I would expect to...
Read more >Can't connect to other containers inside docker network
I found a way to do what I want, but it doesn't seem to be configurable via docker-compose.yml. I have to start the...
Read more >A beginner's guide to networking in Docker | by Uday Hiwarale
Now that we have a running container attached to the bridge network, we should be able to see the container in the Containers...
Read more >4 Reasons Why Your Docker Containers Can't Talk to Each ...
Avoid wasted hours spent on debugging container networking issues by trying ... Attach a running container to a network docker network connect [network] ......
Read more >raspberry pi mesh network batman
We used 7 Raspberry Pi's running the Raspbian OS via the Pi…. Multiple devices can be connected in a mesh using the BATMAN...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The list endpoint returns a shortened representation of the Network object, omitting the list of connected containers among other things. You can also use the
greedy
parameter to load the full data, egMaintainers have lives too. But also, it helps to include as much information as possible when reporting an issue.
In this particular case, this is not a bug; you simply need to call
reload()
on the network object to see the updated list of containers.