dongnan
总版主
总版主
  • 粉丝52
  • 发帖数2165
  • 铜币13236枚
  • 威望5838点
  • 银元150个
  • 社区居民
  • 最爱沙发
  • 忠实会员
  • 原创写手
阅读:233回复:0

如何删除 无效的<none> docker 镜像?

楼主#
更多 发布于:2018-06-26 09:56
目标
删除,带有 <none> 无效的 docker 镜像。

环境
docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:25 2017
 OS/Arch:      linux/amd64
...省略

步骤
1. 列出镜像
# 注意带有 "<none>" 字符的镜像
docker image ls
REPOSITORY                                    TAG                 IMAGE ID            CREATED             SIZE
hub.zongming.net/smartLa/smartLa-bms    1.0.13              85313821b058        About an hour ago   590MB
hub.zongming.net/smartLa/smartLa-bms    <none>              6e9a15974e3e        About an hour ago   590MB
hub.zongming.net/smartLa/smartLa-bms    1.0.12              4f8a717d4ac8        About an hour ago   590MB
hub.zongming.net/smartLa/smartLa-bms    <none>              b7020dcc2d49        About an hour ago   590MB
hub.zongming.net/smartLa/smartLa-bms    <none>              b0397b796e7e        About an hour ago   590MB

2. 删除无效镜像
docker image prune
WARNING! This will remove all dangling images.
Are you sure you want to continue? [y/N] y
Deleted Images:
untagged: xxxxxxxxxx
deleted: sha256:b7020dcc2d49edef30f12e97a01d672d4349b2ada6183e5c4918ee576d729a4b
deleted: sha256:61844cb9aca1c27b76f71674e920a3387f9cd7857d9c3706c1cdcf1873a6e6df
deleted: sha256:65822617cce1d90421eaa0a673466e106a4b5883e3f8f2b9c41517e48600d621
deleted: sha256:4d02624e5521e55133caf254bf5c79dfddcec174f84ce91e88db20c630165bda
...省略

扩展 iamge 子命令
docker image
Usage:    docker image COMMAND
Manage images

Options:
      --help   Print usage

Commands:
  build       Build an image from a Dockerfile
  history     Show the history of an image
  import      Import the contents from a tarball to create a filesystem image
  inspect     Display detailed information on one or more images
  load        Load an image from a tar archive or STDIN
  ls          List images
  prune       Remove unused images
  pull        Pull an image or a repository from a registry
  push        Push an image or a repository to a registry
  rm          Remove one or more images
  save        Save one or more images to a tar archive (streamed to STDOUT by default)
  tag         Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE

Run 'docker image COMMAND --help' for more information on a command.

# 子命令,使用说明。
docker image ls -h
Flag shorthand -h has been deprecated, please use --help
Usage:    docker image ls [OPTIONS] [REPOSITORY[:TAG]]

List images

Aliases:
  ls, images, list

Options:
  -a, --all             Show all images (default hides intermediate images)
      --digests         Show digests
  -f, --filter filter   Filter output based on conditions provided
      --format string   Pretty-print images using a Go template
      --help            Print usage
      --no-trunc        Don't truncate output
  -q, --quiet           Only show numeric IDs


#
游客

返回顶部