FROM scratch
MAINTAINER Aario <AarioAi@gmail.com>
ENV SHARED_GROUP docker
I build a docker image with above dockerfile.
After runing docker build -t "aario/centos" .
It creates this image aario/centos and the <none>
image:
Is it ok? And how to solve it?
When I run docker rmi 2f???????
to remove the aario/centeros image. The <none>
image will be removed on the same time.
Docker image is composed of layers:
docker history aario/centos
Each row you see using command above is a separate layer. Also, with time, some number of orphaned layers will fill up your disk space. You can safely remove them with:
docker image prune
Those are intermediate image layers. I.e, all of the steps of your Dockerfile.
You can check what these images are made of with inspect command:
docker image inspect 2f???????
They do not use additional disk space, since they are part of your named image. They can save space when you have multiple Dockerfiles with the same steps (in the same order) because they work as cache.
A longer and more complete explanation can be found here.
Eventually, if you delete your image or change build steps, you could have dangling none images. Those can be deleted, as @Mike mentioned, with:
docker image prune