📜  带有 ip 的 docker ps - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:10.300000             🧑  作者: Mango

代码示例10
# The --format option of inspect comes to the rescue.

# Modern Docker client syntax is:

docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id

#Old Docker client syntax is:

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