docker run -it -p 8080 myimage /bin/bash
I would expect the code above to expose port 8080 private. However when I run:
docker ps -a
It shows:
0.0.0.0:32770->8080/tcp
How does one set port 8080 to expose only private?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.
Sign up to join this communitydocker run -it -p 8080 myimage /bin/bash
I would expect the code above to expose port 8080 private. However when I run:
docker ps -a
It shows:
0.0.0.0:32770->8080/tcp
How does one set port 8080 to expose only private?
Just realized that it is by default open within the host, so just removing the port flag from run was enough.
Bonus: You may map a port to the host directly via the flag -p 127.0.0.1:8080:8080