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

Local network access to published ports #3

Open
rnbguy opened this issue Apr 5, 2019 · 0 comments
Open

Local network access to published ports #3

rnbguy opened this issue Apr 5, 2019 · 0 comments

Comments

@rnbguy
Copy link

rnbguy commented Apr 5, 2019

In outside-access docker-compose, I need to access vpn:8000 within a local network.

command: sh -c "curl 'https://api.ipify.org?format=json' && curl -v 'http://vpn:8000/'"

I can access it from host by vpn's ip, like 172.17.0.2:8000 if I publish port on vpn as 8000:8000. But it is not reachable from local network if OpenVPN is setup in it. You can try this on https://labs.play-with-docker.com with your docker compose. vpn:8000 will not be accesible from the internet.

I am not very familiar with ip routing, so I am not sure what is going on. I can make it work adding another container with 8000 as published port and using socat to forward that port to vpn:8000 (example). But is there any native docker way to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant