Docker Community Forums

Share and learn in the Docker community.

Accessing 172. network from Docker container


#1

I’m new to Docker. After downloading a container (sagemath) and running it, I get a console message that says I can connect using a URL on http://172.17.0.2:8888/?token=XXX. network. However, when I try from a browser on the host Mac, it does not connect. What am I missing?


#2

Probably, publised a port of your container to the host and using localhost in the URL? The URL would look like this http://localhost:{published host port}/?token=XXX.


#3

That doesn’t work either.


#4

did you publish the port (as in map a host port to a container port)?


#5

Sorry, but how is that done? (I thought that having the networks bridged was enough).


#6

A Docker bridged network is comparable to a NAT network in Virtual Box / VMware Fusion - both worlds require you to map ports from the host to the container/vm to access one of its ports from the host.

Wherever you configure your environment variables and volumes must be a setting to publish/map ports.

Sorry, no Docker-CE UI experience on my side.