Common Docker Commands

List all running the containers

1
docker ps 

That will list only the running containers

To list all the containers (containers—both stopped and currently running)

1
docker ps -a

List the id of the containers

1
docker ps -aq 

To get the full id (without truncating the id)

1
docker ps -aq  --no-trunc 

Remove the container as soon as it stops

1
docker run --name=testing -p 9004:9004 --rm -it test:latest
updatedupdated2024-01-172024-01-17