栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

如何排序或排序结果docker ps

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

如何排序或排序结果docker ps

格式化和订购 docker ps

列出容器

docker ps

格式

docker ps -a --format "table {{.ID}}t{{.Names}}t{{.Ports}}" | (read -r; printf "%sn" "$REPLY"; sort -k 3 )

概要

docker ps [--format="TEMPLATE"]--format="TEMPLATE"  Pretty-print containers using a Go template.  Valid placeholders:     .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.

显示容器及其命令

docker ps --format "{{.ID}}: {{.Command}}"

在表格中显示带有标签的容器

docker ps --format "table {{.ID}}t{{.Labels}}"

在表中显示带有节点标签的容器

docker ps --format 'table {{.ID}}t{{(.Label "com.docker.swarm.node")}}'


转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/370266.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号