Docker Community Forums

Share and learn in the Docker community.

Newbie Needs Help: Mapping a Port

docker

(Natelawrence) #1

I recently discovered an excellent little forced aligner, named Gentle, which will match a text transcript to the audio which it transcribes. You can find a hosted version of it here: lowerquality.com/gentle

They provide their source code via GitHub, however it only runs on Linux and Mac.

They also provide their app for local hosting via Docker.
To pull it down, run: docker run -P lowerquality/gentle

My problem is that on Windows, after Docker pulls down all of Gentle’s files, when I visit localhost:8765 (as directed on Gentle’s GitHub account) in any of my web browsers I am told that the browser cannot connect to/find anything at that address.

I asked for help on Twitter and one of Gentle’s authors got in touch with me and we talked on Hangouts.
His best guess is that I need to map a port in order for my web browsers to talk to the Docker container.
He gave me this link to Docker’s Windows documentation.

I tried the example on Docker’s help page of mapping nginx to port 80 and it works perfectly fine when I type the IP address from Docker’s virtual machine into my web browser address bar.

Sadly, though, I’m too much of a newbie to understand how to map Gentle’s container to a port.

Could anyone give me some simple steps of how to get my web browser talking to Docker’s instance of Gentle?

Thanks in advance
Nate


#2

The -P in the docker run command tells Docker to map all ports the container has exposed to a random port on the docker host. After you run the container, you can see how the ports were mapped with this command:

docker port my_container_name

Another method is to simply specify how you want the ports mapped when you run the container with -p instead of -P

docker run -p 80:80 -p 443:443 lowerquality/gentle

Again, this maps ports to the docker host, not your native Windows system. So, if the VM acting as the Docker host has an IP of 192.168.99.100, then that is what you connect to in the browser.