Skip to content

Instantly share code, notes, and snippets.

@charlie-nguyen-goldenowl-zz
Last active July 28, 2020 04:04
Show Gist options
  • Save charlie-nguyen-goldenowl-zz/34f8ce83971089f48326cd45a17096fd to your computer and use it in GitHub Desktop.
Save charlie-nguyen-goldenowl-zz/34f8ce83971089f48326cd45a17096fd to your computer and use it in GitHub Desktop.
docker-canban.md

images

hien thi tat ca images

sudo docker images

xoa image

sudo docker rmi ten_image

container

To show only running containers use the given command:

docker ps

To show all containers use the given command:

docker ps -a

To show the latest created container (includes all states) use the given command:

docker ps -l

To show n last created containers (includes all states) use the given command:

docker ps -n=-1

To display total file sizes use the given command:

docker ps -s

The content presented above is from docker.com.

In the new version of Docker, commands are updated, and some management commands are added:

docker container ls

It is used to list all the running containers.

docker container ls -a

And then, if you want to clean them all,

docker rm $(docker ps -aq)

It is used to list all the containers created irrespective of its state.

And to stop all the Docker containers (force)

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

Here the container is the management command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment