Docker – Essential Commands

CommandsDescription
docker psList all running containers
docker ps -aList all containers stopped, running
docker stop container-idStop the container which is running
docker start container-idStart the container which is stopped
docker restart container-idRestart the container which is running
docker port container-idList port mappings of a specific container
docker rm container-id or nameRemove the stopped container
docker rm -f container-id or nameRemove the running container forcefully
docker pull image-infoPull the image from docker hub repository
docker pull Pull the image from docker hub repository
docker exec -it container-name /bin/shConnect to linux container and execute commands in container
docker rmi image-idRemove the docker image
docker logoutLogout from docker hub
docker login -u username -p passwordLogin to docker hub
docker statsDisplay a live stream of container(s) resource usage statistics
docker top container-id or nameDisplay the running processes of a container
docker versionShow the Docker version information

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.