Reputation: 1
I am a new guy to get into Docker. I have a problem, in my host machine, I ran a nginx container docker run -d --name mynginx -p 80:80 nginx
, and I can access 80 port on my host machine.Acess 80 port works
But if I map another port other than 80 on host machine, then it seems not work. docker run -d --name mynginx -p 80:8888 nginx
.Acess 8888 port not work
Someone can tell me why and how to fix it?
Upvotes: 0
Views: 277
Reputation: 168
The order is host:container.
So in your case, this is what you need:
docker run -d --name mynginx -p 8888:80: nginx
Upvotes: 1