How to access container web application from host

I am launching a site inside a Docker container that exports the following https://172.17.0.2:8443/admin/& http://172.17.0.2:8463/users/

$ docker run -it -d --expose=8000-9900 ubuntu-java8-webapp bf193d011fd8.... 

Docker PS cmd

 $ docker ps -a CONTAINER ID IMAGE COMMAND PORTS NAMES bf193d011fd8 ubuntu-.... "/bin/bash" 8000-9900/tcp desperate_mclean 

Docker ls cmd

 $ docker-machine ls NAME ACTIVE DRIVER STATE URL DOCKER ERRORS default * virtualbox Running tcp://192.168.99.100:2376 v1.10.3 

Docker machine ip cmd

 $ docker-machine ip default 192.168.99.100 

How do I access the site? Just in case this is important, I run dockers on Mac here.

+5
source share
1 answer

You can try and access it through the IP docker machine:

 https://192.168.99.100:8443/admin http://192.168.99.100:8463/users 

But ideally, you would:

+7
source

Source: https://habr.com/ru/post/1245527/


All Articles