How to get IP address of running docker container

后端 未结 7 952
情话喂你
情话喂你 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:06

    Use --format option to get only the IP address instead whole container info:

    sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' 
    

提交回复
热议问题