Skip to content

Local network access to published ports #3

Description

@rnbguy

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions