New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use ExposedPorts for --net=host #268

Merged
merged 1 commit into from Sep 15, 2016

Conversation

Projects
None yet
5 participants
@wrouesnel
Contributor

wrouesnel commented Oct 13, 2015

Simple change to support the fact that docker no longer fills out mapped ports when run in --net=host mode. This instead simply reads all exposed ports and fills out the relevant service structure, restoring the original functionality.

Fixes #159

@ghostbar

This comment has been minimized.

Show comment
Hide comment
@ghostbar

ghostbar Nov 3, 2015

This is a very simple patch, I tested it and it's working. Please merge.

ghostbar commented Nov 3, 2015

This is a very simple patch, I tested it and it's working. Please merge.

@mgood

This comment has been minimized.

Show comment
Hide comment
@mgood

mgood Dec 1, 2015

Contributor

Thanks for looking into this, but what about containers that are not run with --net=host? From what I'm seeing in the API, ExposedPorts may work for --net=host now, though in other cases wouldn't you still need to use PortBindings in order to register the ports that are bound to the Docker bridge?

Contributor

mgood commented Dec 1, 2015

Thanks for looking into this, but what about containers that are not run with --net=host? From what I'm seeing in the API, ExposedPorts may work for --net=host now, though in other cases wouldn't you still need to use PortBindings in order to register the ports that are bound to the Docker bridge?

@wrouesnel

This comment has been minimized.

Show comment
Hide comment
@wrouesnel

wrouesnel Dec 1, 2015

Contributor

ExposedPorts is always populated with the port number exposed on the host of any port (at least on Docker 1.9 on my laptop here).

If I run docker run -p 220:22000 -it debian /bin/bash, then I get

        "ExposedPorts": {
            "22000/tcp": {}
        },

back from docker inspect.

Contributor

wrouesnel commented Dec 1, 2015

ExposedPorts is always populated with the port number exposed on the host of any port (at least on Docker 1.9 on my laptop here).

If I run docker run -p 220:22000 -it debian /bin/bash, then I get

        "ExposedPorts": {
            "22000/tcp": {}
        },

back from docker inspect.

@albamc

This comment has been minimized.

Show comment
Hide comment
@albamc

albamc May 13, 2016

this patch is useful when you use macvlan modes too.

albamc commented May 13, 2016

this patch is useful when you use macvlan modes too.

@josegonzalez

This comment has been minimized.

Show comment
Hide comment
@josegonzalez

josegonzalez Sep 15, 2016

Member

This looks good to me. @mattaitchison can you give this a quick glance and tell me I'm not being dumb? It's mergeable otherwise :)

Member

josegonzalez commented Sep 15, 2016

This looks good to me. @mattaitchison can you give this a quick glance and tell me I'm not being dumb? It's mergeable otherwise :)

@josegonzalez josegonzalez merged commit db7c8bd into gliderlabs:master Sep 15, 2016

1 check passed

ci/circleci Your tests passed on CircleCI!
Details

This was referenced Jun 25, 2018

Closed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment