Useful Docker Commands

Today I learned some docker commands, let me share it with you:

To stop all containers simply type:

docker kill $(docker ps -q)

docker ps – list all running containers

flag -q – displays only ids of these containers

docker kill -…


This content originally appeared on DEV Community and was authored by Damian Brdej

Today I learned some docker commands, let me share it with you:

To stop all containers simply type:

docker kill $(docker ps -q)

docker ps - list all running containers

flag -q - displays only ids of these containers

docker kill - stops containers

If you want to remove all containers use the command:

docker rm $(docker ps -a -q)

docker rm - removes containers

flag -a - lists all containers not only running ones

The rest is similar to previous command

To remove all docker images type:

docker rmi $(docker images -q)

docker rmi - removes images

docker images - q - lists ids of all images


This content originally appeared on DEV Community and was authored by Damian Brdej


Print Share Comment Cite Upload Translate Updates
APA

Damian Brdej | Sciencx (2021-11-22T21:22:02+00:00) Useful Docker Commands. Retrieved from https://www.scien.cx/2021/11/22/useful-docker-commands/

MLA
" » Useful Docker Commands." Damian Brdej | Sciencx - Monday November 22, 2021, https://www.scien.cx/2021/11/22/useful-docker-commands/
HARVARD
Damian Brdej | Sciencx Monday November 22, 2021 » Useful Docker Commands., viewed ,<https://www.scien.cx/2021/11/22/useful-docker-commands/>
VANCOUVER
Damian Brdej | Sciencx - » Useful Docker Commands. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/11/22/useful-docker-commands/
CHICAGO
" » Useful Docker Commands." Damian Brdej | Sciencx - Accessed . https://www.scien.cx/2021/11/22/useful-docker-commands/
IEEE
" » Useful Docker Commands." Damian Brdej | Sciencx [Online]. Available: https://www.scien.cx/2021/11/22/useful-docker-commands/. [Accessed: ]
rf:citation
» Useful Docker Commands | Damian Brdej | Sciencx | https://www.scien.cx/2021/11/22/useful-docker-commands/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.