Docker localhost process not working on Windows
I am using Docker Quickstart Terminal to run a docker container. The container should work on port
docker run -it --name myContainer -p 8088:8088
However, when I go to
127.0.0.1:8088 I can’t find any process running.
This works on OSX.
Why is this not working on Windows?
2 Solutions collect form web for “Docker localhost process not working on Windows”
I’m assuming you’re using VirtualBox, since that’s what is integrated with the Quickstart terminal.
The reason it doesn’t work is that Windows isn’t running your (Linux) containers natively, it’s running them in a separate Linux-based VM. This VM is available under a different ip address than your “physical” machine, usually printed when you start the quickstart terminal:
This is the ip address you need to use in order to connect to published container ports.
One possibility is the kind of VM you are using : HyperV (Docker For Windows) or VirtualBox (Docker Toolbox).
If it is the later (which seems probable since you are using the Docker Quickstart Terminal), you need to port forward 8088 in order for your PC (localhost) to see it.
See “How do I configure docker compose to expose ports correctly?” as an example when using VirtualBox.
If localhost does not work, a
docker-machine ip will show you the ip of the VM being executed.