When running Docker for a long time, there are a lot of images in system. How can I remove all unused Docker images at once safety to free up the storage?
In additio
Remove old containers weeks ago.
docker rm $(docker ps -a | grep "weeks" | awk '{ print $1; }')
Remove old images weeks ago. Be careful. This will remove base images which was created weeks ago but which your new images might be using.
docker rmi $(docker images | grep 'weeks' | awk '{ print $3; }')