How to get IP address of running docker container

2020-05-11 10:18发布

I am using Docker for Mac. I am running a nodejs based microservice in a Docker container. I want to test node microservice through the browser. How to get IP address of running docker container?

7条回答
聊天终结者
2楼-- · 2020-05-11 11:13

You can not access the docker's IP from outside of that host machine. If your browser is on another machine better to map the host port to container port by passing -p 8080:8080 to run command.

Passing -p you can map host port to container port and a proxy is set to forward all traffix for said host port to designated container port.

查看更多
登录 后发表回答