% docker # Remove an image docker image rm # Remove an image from the local image store docker rmi # Remove all images from the local image store docker rmi $(docker images -q) --force # Remove all containers docker rm $(docker ps -aq) # Stop all containers docker stop $(docker ps -aq) # List all images that are locally stored with the Docker engine docker images # Build an image from the Dockerfile in the current directory and tag the image docker build -t : . # Pull an image from a registry docker pull : # Stop a running container through SIGTERM docker stop # Stop a running container through SIGKILL docker kill # List the networks docker network ls # List the running containers docker ps # Delete all running and stopped containers docker rm -f "$(docker ps -aq)" # Create a new bash process inside the container and connect it to the terminal docker exec -it bash # Print the last lines of a container's logs docker logs --tail 100 | less # Print the last lines of a container's logs and following its logs docker logs --tail 100 -f # Create new network docker network create $ image_id: docker images --- --headers 1 --column 3 --delimiter '\s\s+' $ container_id: docker ps --- --headers 1 --column 1 --delimiter '\s\s+' % docker, boot # Prevent all containers from autostarting on boot docker update --restart=no $(docker ps -a -q)