mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-03-25 19:25:27 +00:00
Add blank lines before headers
This commit is contained in:
@@ -82,6 +82,7 @@ Build Cache 0 0 0B 0B
|
||||
#### 按仓库名过滤
|
||||
|
||||
```bash
|
||||
|
||||
## 列出所有 ubuntu 镜像
|
||||
|
||||
$ docker images ubuntu
|
||||
@@ -110,6 +111,7 @@ ubuntu 24.04 329ed837d508 78MB
|
||||
| `reference=pattern` | 按名称模式 | `-f reference='*:latest'` |
|
||||
|
||||
```bash
|
||||
|
||||
## 列出 nginx 之后创建的镜像
|
||||
|
||||
$ docker images -f since=nginx:latest
|
||||
@@ -147,6 +149,7 @@ REPOSITORY TAG IMAGE ID SIZE
|
||||
#### 处理虚悬镜像
|
||||
|
||||
```bash
|
||||
|
||||
## 列出虚悬镜像
|
||||
|
||||
$ docker images -f dangling=true
|
||||
@@ -190,6 +193,7 @@ $ docker images -q
|
||||
常用于配合其他命令:
|
||||
|
||||
```bash
|
||||
|
||||
## 删除所有镜像
|
||||
|
||||
$ docker rmi $(docker images -q)
|
||||
@@ -218,6 +222,7 @@ nginx latest sha256:b4f0e0bdeb5... e43d811ce2f4
|
||||
使用 Go 模板语法自定义输出:
|
||||
|
||||
```bash
|
||||
|
||||
## 只显示 ID 和仓库名
|
||||
|
||||
$ docker images --format "{{.ID}}: {{.Repository}}"
|
||||
@@ -251,6 +256,7 @@ ubuntu 24.04 78MB
|
||||
### 4.2.8 常用命令组合
|
||||
|
||||
```bash
|
||||
|
||||
## 列出所有镜像及其大小,按大小排序(需要系统 sort 命令)
|
||||
|
||||
$ docker images --format "{{.Size}}\t{{.Repository}}:{{.Tag}}" | sort -h
|
||||
|
||||
Reference in New Issue
Block a user