Random port binding not showing up in the .attr object
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7.2k
- Forks
- 1.7k
- Avg merge
- 13d 8h
- Merged PRs (30d)
- 2
Description
I run a container and use the option ports={8000: None} in order to assign random port binding for this container. I then try to print the container.attr to look for what port did it bind to. It always get empty values: u'PortBindings': {u'8000/tcp': [{u'HostPort': u'', u'HostIp': u''}]}
I use the shell to make sure the container is running and binding ports correctly, and it works just fine. The container is indeed running the ports are bind correctly. But I need to access the port binding from the container object.
What is the problem here?
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
Start by reproducing the issue with the Python ports={8000: None} option, then compare container.attr with the port information shown by the shell while the container is running. No source file or test is named; done means the container object exposes the assigned random host port consistently with the running container.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100