Can the image of none in images in Docker be deleted?

Can the image of none in images in Docker be deleted?

 

I am worried that there will be problems after deleting it, Xiaobai user. Check the information or gain a lot. Briefly translate an article from abroad, please correct me if I'm wrong.

 

  1. What are  <none>:<none> images ? What are <none>:<none> images?
  2. What are dangling images ? What are "temporary" or dangling images?
  3. Why do I see a lot of  images<none>:<none>  when I do  docker images -a ?
  4. What is the difference between  docker images and  docker images -a ?        What is the difference between docker images and docker images -a what you see?
 
The article mainly answers these questions, combining the principle of docker image.
There are good <none>:<none> images and bad <none>:<none> images. How did they get here?"
 
Good <none>: <none> image generation
 
For example, take a fedora image from a mirror repository. Although the figure docker images only showsfedora:latest,但是docker images -a 显示了两个镜像fedora:latest 和<none>:<none>
It turns out that the images in docker have a vertical parent-child relationship, and the hierarchical relationship can be seen in /var/lib/docker/graph. When docker pull fedora is executed, it will download one image at a time.
 
The parent-child relationship can be viewed by looking at the json of /var/lib/docker/graph. None of these images cause storage space occupancy issues.
 
root@iZ2zejcwx7sfb1o4vvupxkZ:/var/lib/docker/graph# more ff0e2b608af6b1901d8ad9e9556e9e8ffe91b4c5386039e32bdf087df6157f65/json
{"container_config":{"Hostname":"","Domainname":"","User":"","AttachStdin":false,"AttachStdout":false,"AttachStderr":false,"Tty":fal
se,"OpenStdin":false,"StdinOnce":false,"Env":null,"Cmd":["/bin/sh -c echo 'export PATH=$ORACLE_HOME/bin:$PATH' \u003e\u003e /etc/bas
h.bashrc"],"Image":"","Volumes":null,"WorkingDir":"","Entrypoint":null,"OnBuild":null,"Labels":null},"created":"2016-04-20T10:29:03.
276290831Z","layer_id":"sha256:a5d9cef8ef2a0ffd19fea965e22924c2717bdcec82f628344111ae5aeec3ec13","parent_id":"sha256:c74e9fd53a7e49d
4d4cd562a69aa8ccc094ee17aedb7cc26a161af2903af8f68"}
root@iZ2zejcwx7sfb1o4vvupxkZ:/var/lib/docker/graph# 
 
 
 
Bad <none>: <none> image generation
docker build Or  the pull command will generate a temporary image. If we use dockerfile to create a helloworld image and need to recreate it because of a version update, the image of the previous version will be
become a temporary mirror. This needs to be deleted. See below for the delete command.
 
 
Clean up bad <none>:<none> images

docker rmi $(docker images -f "dangling=true" -q)

 

 

If you use sudo, you need to add sudo before and after. . . . . .

 

Original: http://www.projectatomic.io/blog/2015/07/what-are-docker-none-none-images/

 

 

http://blog.csdn.net/goflyfreely/article/details/53149894

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326864661&siteId=291194637