Useful Docker Commands

The following are some useful docker commands that I haven’t yet committed to memory.

Delete all containers

$(echo docker ps -aq) | while read -r line; do docker rm "${line}"; done

WARNING: As with rm -rf on Linux, this action is not reversible. Take care when using this command.

docker system prune -a -f