Skip to content
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

Exposed port to multiple addresses: only one IP address shows up #113

Closed
bfejervari opened this issue Mar 23, 2024 · 3 comments
Closed

Exposed port to multiple addresses: only one IP address shows up #113

bfejervari opened this issue Mar 23, 2024 · 3 comments

Comments

@bfejervari
Copy link

I have a docker container (FreeIPA), which has it's DNS server port (:53) exposed to 127.0.0.1 and 192.168.200.8 addresses.
The docker run command part:

    -p 127.0.0.1:53:53 -p 127.0.0.1:53:53/udp \
    -p 192.168.200.8:53:53 -p 192.168.200.8:53:53/udp \

The same part in the docker inspect output:

                "53/tcp": [
                    {   
                        "HostIp": "127.0.0.1",
                        "HostPort": "53"
                    },
                    {   
                        "HostIp": "192.168.200.8",
                        "HostPort": "53"
                    }
                ],
                "53/udp": [
                    {   
                        "HostIp": "127.0.0.1",
                        "HostPort": "53"
                    },
                    {   
                        "HostIp": "192.168.200.8",
                        "HostPort": "53"
                    }
                ],

The problem: using runlike shows only the first IP address as a -p ... parameter.

@lavie
Copy link
Owner

lavie commented Mar 24, 2024

Indeed it seems runlike only uses the first item in the list:

host_ip = options[0]['HostIp']

A good first issue to try to solve if someone wants to have a crack at this.
Thank you for reporting!

@ByteBaker
Copy link

@lavie I've verified that this problem no longer exists.

Docker run:
docker run --name ubuntu -p 127.0.0.1:53:53 -p 127.0.0.1:53:53/udp -d ubuntu sleep infinity

Runlike output:
docker run --name=ubuntu --hostname=a4fee37b7072 --mac-address=<redacted> --network=bridge -p 127.0.0.1:53:53 -p 127.0.0.1:53:53/udp --runtime=runc --detach=true ubuntu sleep infinity

The issue can be closed now.

@lavie
Copy link
Owner

lavie commented Sep 20, 2024

Indeed it was recently solved by a contributor probably in this PR: #116
Thank you for noticing. Will close this now.

@lavie lavie closed this as completed Sep 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants