How to get IP address of running docker container

后端 未结 7 953
情话喂你
情话喂你 2020-12-12 14:31

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 run

7条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 15:18

    You can start your container with the flag -P. This "assigns" a random port to the exposed port of your image.

    With docker port you can see the randomly choosen port. Access is then possible via localhost:port.

提交回复
热议问题