docker containers connected to a network when run won't show up in network_object.containers field
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
when 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.containersfield 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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the sequence using client.networks.create, client.containers.run with the network name, and client.networks.get, then inspect how network_object.containers is populated and refreshed. No file or test is named in the issue; done means the original network object reports the connected container without requiring a second get.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100