tadab
tadab

Reputation: 23

How to access to container docker from browser in windows 10

I am running docker in windows 10 professional edition. I need to access to container with browser.

screenshot of running container

I tried to access by typing : http://172.17.0.2:9000 and http://localhost:9000

But my browser says:

This site can’t be reached
172.17.0.2 took too long to respond.

Any ideas to resolve this?

Upvotes: 2

Views: 9299

Answers (3)

CookieThief
CookieThief

Reputation: 168

Simply Go to Settings -> General -> activate Expose daemon

Expose daemon on tcp://localhost:2375 without TLS: Click this option to enable legacy clients to connect to the Docker daemon. You must use this option with caution as exposing the daemon without TLS can result in remote code execution attacks.

https://docs.docker.com/docker-for-windows/

Upvotes: 0

Your container web service should start using 0.0.0.0 host instead localhost, in that way you can access from your local machine.

Upvotes: 1

Abhishek D K
Abhishek D K

Reputation: 2427

use simpleDockerUI which is a chrome extension. and enter you docker daemon IP https://"docker-machine ip":2376

before connecting via simpleDockerUI, import the docker certificates
inside the chrome certificates

go to the folder where docker certificates are installed(in my machine it was in C:\Users\"name"\.docker\machine\machines\default)
then do the following steps

1) $ cat cert.pm ca.pem >> clientcertchain.pem
2) $ openssl pkcs12 -inkey key.pm -in clientcertchain.pem -export -out import.pfx -passout pass:"password"
3) now go to google chrome setting --> manage certificates
4) under trusted root certification authoirities import ca.pem. it will prompt for password ( same as above)
5) import import.pfx as a personal certificate under personal certificate tab (it will ask to set the password so set it)

to test the connection open new tab in google chrome and type https://ip:2376/_ping
you should get OK response

or use portainer image
docker run -d -p 9000:9000 portainer/portainer

Upvotes: 1

Related Questions