Docker commands

When using Docker in development environment, you might need to restart or clean docker containers fully. Here are some helpful commands.

List all containers (only IDs)

docker ps

Search container by name

docker ps --filter "name=container_name"

Stop all running containers

docker stop $(docker ps -aq)

Remove all containers

docker rm $(docker ps -aq)

Remove all images

docker rmi $(docker images -q)
Author: Danyal
I'm working as programmer since 2002. Born, grew up, studied and worked in Pakistan now Im located in Denmark since 2006.