How do I connect to a container hosted in Docker Toolbox?

后端 未结 2 1938
花落未央
花落未央 2021-01-17 01:10

I am attempting to run my ASP.NET Core 1.1 web API in a Docker container, but I cannot connect to the web API from a browser or curl. To troubleshoot, I have a

相关标签:
2条回答
  • As you are running on VM, you need to follow this docker document from here.

    After that run the following command to check the IP address of your VM.

    docker-machine ip default
    

    Start the nginx and hit [ip default address]:port in the browser. It works!

    0 讨论(0)
  • 2021-01-17 01:20

    I have found the answer in another question here.

    Because Docker Toolbox is running on a lightweight Linux VM, it has its own IP address. One needs either to map localhost to the VM using DOCKER_HOST ir access the VM via it's IP address, found using the command:

    docker-machine ip default
    
    0 讨论(0)
提交回复
热议问题