I’ve been using Docker for quite some time, but never had unused container images. This is partially because I installed a new hard drive and started from a blank slate, but also because I haven’t needed to use many different images to build my containers.
I’ve changed jobs recently and wanted to set up a container to mirror our web server. Which meant trying to get a CentOS 6.8 container going. Except there isn’t one from Cent anymore. And I don’t exactly trust random-dude-from-the-Internet’s OS. Download it and poke around without running it, sure … but that’s not a platform on which I can do my development.
And that means I’ve got a few images that I do not need. To view the list of images, use “docker images -a”
D:\docker>docker images -a
REPOSITORY TAG IMAGE ID CREATED SIZE
openhab/openhab snapshot 8a4749c86ff3 4 weeks ago 527MB
docker4w/nsenter-dockerd latest 2f1c802f322f 9 months ago 187kB
centos/php-56-centos7 latest 92ed8b3a7cb4 15 months ago 617MB
13652604711/centos6.8-ssh latest 59ab169b5158 2 years ago 289MB
Then use “docker rmi imagename” to remove any unnecessary ones.
D:\docker>docker rmi centos/php-56-centos7
D:\docker>docker rmi 13652604711/centos6.8-ssh