docker images 如何显示指定的列?

docker images

REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
<none>              <none>              67a11e174a69        26 hours ago        455 MB
dt                  latest              14f60031763d        2 days ago          120 MB

如果我想只显示 REPOSITORY、IMAGE ID、SIZE 这三列应该如何使用命令?

阅读 5k
2 个回答

利用这个命令:
docker images --format "table {{.ID}}\t{{.Repository}}\t{{.Size}}"

docker images --help

--format string   Pretty-print containers using a Go template
//这句描述不太清楚, 好像是说GO语言的模板格式 --)
docker ps --format "{{.ID}}: {{.Command}}"
Placeholder    Description
.ID    Container ID
.Image    Image ID
.Command    Quoted command
.CreatedAt    Time when the container was created.
.RunningFor    Elapsed time since the container was started.
.Ports    Exposed ports.
.Status    Container status.
.Size    Container disk size.
.Names    Container names.
.Labels    All labels assigned to the container.
.Label    Value of a specific label for this container. For example '{{.Label "com.docker.swarm.cpu"}}'
.Mounts    Names of the volumes mounted in this container.
.Networks    Names of the networks attached to this container.

官方文档: https://docs.docker.com/engin...

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题
宣传栏