我在Docker容器中运行一个站点,导出以下内容
https://172.17.0.2:8443/admin/>
http://172.17.0.2:8463/users/
$docker run -it -d --expose=8000-9900 ubuntu-java8-webapp
bf193d011fd8....
Docker PS cmd
$docker ps -a
CONTAINER ID IMAGE COMMAND PORTS NAMES
bf193d011fd8 ubuntu-.... "/bin/bash" 8000-9900/tcp desperate_mclean
Docker ls cmd
$docker-machine ls
NAME ACTIVE DRIVER STATE URL DOCKER ERRORS
default * virtualBox Running tcp://192.168.99.100:2376 v1.10.3
Docker机器ip cmd
$docker-machine ip default
192.168.99.100
我如何访问该网站?万一重要的是,我在Mac上运行docker.
最佳答案
您可以尝试通过docker机器IP访问它:
原文链接:https://www.f2er.com/docker/436744.htmlhttps://192.168.99.100:8443/admin
http://192.168.99.100:8463/users
但理想情况下,你会:
>将这些端口映射到主机:
docker run -p 8443:8443 -p 8463:8463 ...
> port-forward those port to your actual host through VirtualBox VM Network setting,并访问该网站: