November 2017
Intermediate to advanced
298 pages
7h 10m
English
First up is the cleanup of all containers that you have run but have forgotten to use --rm by using docker rm:
$ docker rm $(docker ps -aq)86604ed7bb17<snip>7f7178567aba
This command effectively finds all containers (docker ps), even the ones that you stopped (the -a flag), and only returns their IDs (the -q flag). This is then passed on to docker rm, which will try to remove them one by one. If any containers are still running, it will give you a warning and skip them. Generally, this is just a good thing to do as often as you want if your containers are stateless or have a state stored outside of the container itself.
The next thing up, though potentially much more destructive and more space-saving, is deleting Docker images ...
Read now
Unlock full access