Docker commands list

Docker commands list

show list of running docker containers list

docker container ls

show list of docker containers list

docker container ls -a

start docker by name

docker start ubantu_iamge_test

show stop by name

docker stop ubantu_iamge_test

run command in docker and get back result

docker exec ubantu_iamge_test ls

connect docker terminal with disconnect

docker exec -it ubantu_iamge_test bash

Install and run any docker file

docker run -it ubuntu

To delete all containers including its volumes use,

docker rm -vf $(docker ps -aq)

To delete all the images,

docker rmi -f $(docker images -aq)

check list all images

docker images

See all container history

docker ps -a

Allow port

ufw allow 5000

Allow specific port on docker

docker run -d -p 5000:80 nginx

check running docker container

docker ps

stop specific containers by container ID

docker stop {containerID}

remove all stop containers

docker system prune

stop container

docker rm -f {containerID}