简体   繁体   中英

Windows 10 Home :can't reach ‘localhost:8000’ using Docker

I'm beginning to use Docker and following the tutorial ( https://docs.docker.com/get-started/part2/ ) and I am stuck at this point:

docker run --publish 8000:8080 --detach --name bb bulletinboard:1.0

When I try to reach localhost:8080 it says "impossible to reach the site".

When I run docker-machine ip and visiting http://192.168.99.100:8080 with a web client, it does not work.

Please access with port 8000 like localhost:8000 because you mapping docker port from 8080 to 8000 to access from outsaide docker container

Change Port from 8080 to 8000 like this http://192.168.99.100:8000 because you connect machine port 8000 to docker port 8080.

I hope it may help you.

When you use docker commands, always remember.. outside_world -> docker_world

In your 8000:8080 means. You open your container to outside world on port 8000 , inside docker its 8080

Or simply mapping docker port 8080 to 8000 outside.

In this configuration, you should use localhost:8000

docker-machine ip this is completely different network, thats why you can not access it. Its container network.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM