云游屋
扫描关注云游屋

云游屋

docker inspect 命令

云游屋2021-09-06Docker命令 933

该命令用于检查容器或镜像的详细信息。

语法

docker inspect [OPTIONS] NAME|ID [NAME|ID...]

实例

查看 test 容器的详细信息

docker inspect test

注意

该命令可使用--format=''参数来根据GO模板设置过滤信息,如:
查看 test 容器的 IP 地址

$ docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' test
172.17.0.3

帮助

$ docker inspect --help

Usage:  docker inspect [OPTIONS] NAME|ID [NAME|ID...]

Return low-level information on Docker objects

Options:
  -f, --format string   Format the output using the given Go template
  -s, --size            Display total file sizes if the type is container
      --type string     Return JSON for specified type


发表评论