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

后端 未结 6 1440
醉酒成梦
醉酒成梦 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:20

    For those who tried localhost:4000 as the tutorial said but failed:

    Input this:

    $ docker-machine env
    

    and you will see something like:

    export DOCKER_TLS_VERIFY="1"
    export DOCKER_HOST="tcp://192.168.99.100:2376"
    export DOCKER_CERT_PATH="/Users/choi/.docker/machine/machines/dummy"
    export DOCKER_MACHINE_NAME="dummy"
    

    So you get the IP: 192.168.99.100. Then just visit 192.168.99.100:4000, as ip:your_port.

提交回复
热议问题