How to get IP address of running docker container

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

    if you want to obtain it right within the container, you can try

    ip a | grep -oE "\b([0-9]{1,3}\.){3}[0-9]{1,3}\b" | grep 172.17
    

提交回复
热议问题