Docker Short Cheat Sheet

To stop all docker containers:

$ docker stop $(docker ps -a -q)

Then to remove all docker containers:

$ docker rm $(docker ps -a -q)

To remove all docker images:

$ docker rmi $(docker images -q)

Stop specific docker container:

docker ps -a
then copy container is ie: c38ba5c03ab7
docker stop c38ba5c03ab7

Run bash shell in docker image:

$ docker exec -it RUNNING_CONTAINER_NAME /bin/bash

Leave a Reply

Your email address will not be published. Required fields are marked *

Reload Image