How to ssh into a docker container running on a different network?

2/19/2021

I have a docker container running on a local host with private ip 172.17.0.3. I want this to be publicly accesible over the internet so that anyone in the world can ssh into this docker container. Is this possible and if possible how? I am trying to create a small public cloud filled with instances of docker containers in my local network which people from all over the world can access and I am sitting behind a NAT which might cause issues.

Any help will be appreciated.

-- SAPTARSI SAHA
docker
kubernetes
linux
networking

1 Answer

2/19/2021

Forward port from inside container to the host please, for example

docker run -it --name mydocker -p 8080:80 docker/tensorflow:latest
-- xuanloctn
Source: StackOverflow