Docker image prune -a command not reclaiming any space

ade1e asked:

Why is the docker image prune -a command not reclaiming any space?

$ docker container ls
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES

No containers running.

$ docker image ls
REPOSITORY   TAG       IMAGE ID       CREATED          SIZE
awsdevenv    latest    41d1e7913346   2 minutes ago    1.57GB
<none>       <none>    da7eb8c6161b   52 minutes ago   1.57GB

My (probably incorrect) understanding is that docker image ls shows 1.57GB x 2 used space for these images.

$ docker image prune -a
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] y
Deleted Images:
deleted: sha256:da7eb8c6161b53f9c93e2cf88a53d48dd44e412302c940b34f0efc680da22ebc
untagged: awsdevenv:latest
deleted: sha256:41d1e7913346f59695b573ef04b87f6d05d35333bd07839a5a5b0295e57fa274

Total reclaimed space: 0B

But the total reclaimed space is the shown as 0. Why is this?

My answer:


docker container ls shows only running containers. Use docker container ls -a to show running and stopped containers. (Docs)

Now you should see the containers that still exist.


View the full question and any other answers on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.