Skip to content

Random port binding not showing up in the .attr object #1436

Open
@abdelrahmanhosny

Description

@abdelrahmanhosny

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions