I've finished work on a machine's docker setup, and now would like to remove the extra images I'm no longer using to reclaim that disk space. However, the following command I've located returns nothing, even though there are easily 20+ images without a container:
docker images --filter "dangling=true" -q
Is this a recent docker change that I'm not aware of?
root@server:~# docker version
Client:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 22:11:10 2016
OS/Arch: linux/amd64
Server:
Version: 1.12.0
API version: 1.24
Go version: go1.6.3
Git commit: 8eab29e
Built: Thu Jul 28 22:11:10 2016
OS/Arch: linux/amd64
root@server:~# docker info
Containers: 10
Running: 9
Paused: 0
Stopped: 1
Images: 44
Server Version: 1.12.0
Storage Driver: aufs
Root Dir: /var/lib/docker/aufs
Backing Filesystem: extfs
Dirs: 224
Dirperm1 Supported: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: null bridge host overlay
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Security Options: apparmor seccomp
Kernel Version: 4.4.0-34-generic
Operating System: Ubuntu 16.04.1 LTS
OSType: linux
Architecture: x86_64
CPUs: 3
Total Memory: 992.2 MiB
Name: vps1
ID: AVQ7:XQVN:KDDU:SS3J:GYXH:Q5OI:TUUF:4MLO:EJJK:L3PL:XMLF:MPZ5
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: No swap limit support
Insecure Registries:
127.0.0.0/8
The dangling filter finds untagged images(docs), like this one:
I didn't see any filters that looked at running state, so your workaround is a good approach to delete all images (even with tags) that are not in use.