Skip to main content

Command Palette

Search for a command to run...

Docker Essential Commands

Updated
2 min read
Docker Essential Commands
D

Hi there! I'm Dinesh, a passionate Cloud and DevOps enthusiast. I love to dive into the latest new technologies and sharing my journey through blog.

As a DevOps professional or system engineer, mastering Docker commands is essential for efficiently managing containerized applications

Docker Hub :

Login into Docker

docker login -u

To get docker image from Docker Hub

docker pull <image_name>

Publish an image to Docker Hub

docker push <image_name>

Logout from Docker Hub

docker logout

Docker Image :

List docker images

docker images

Build an image from a DokerFile

doker build -t <image_name>

Delete an image

docker rmi <image_name>

To take image Backup

docker save -o <enter path location/filename.tar> <image_name:tag>

To load / Revert deleted image file

docker load -i <backup image name>

Docker Container :

List containers

docker ps

New container launch (Run a container with and publish a container's port to the host)

docker run -itd -p "<host_port>:<con_port>"

Start an existing container

docker start <con_name> or <con_id>

Stop an existing container

docker stop <con_name> or <con_id>

Open through /bin/bash inside a running container (Go to inside the container)

docker exec -it <con_name> or <con_id> /bin/bash

To view the container logs

docker logs <con_name> or <con_id>

To inspect the container details

docker inspect <con_name> or <con_id>

To view the details (Like task manager)

docker top <con_name> or <con_id>

To check the container memory status

docker stats <con_name> or <con_id>

To change/convert container to image

docker commit <con_id> <set_image_name:tag>

DevOps

Part 1 of 50

In this series, I will explain about DevOps tools

More from this blog

Dinesh's Blog

104 posts