docker-machine: Can't access container's web server from host

后端 未结 6 1439
醉酒成梦
醉酒成梦 2020-12-23 09:39

I just installed Docker with Docker-Toolbox on my Mac using homebrew: install docker with homebrew

After creating and configuring a Container with Rails, Postgres an

6条回答
  •  [愿得一人]
    2020-12-23 10:33

    After exposed the port, you can access the web app by the internal IP address created by docker. You can get the IP address using the container's name running the command:

    docker inspect --format '{{ .NetworkSettings.IPAddress }}' 'container name here'
    

    Let's say that you got the IP 172.17.0.2. You can run open http://172.17.0.2:8000

提交回复
热议问题