Skip to main content

📢 Essential Docker Commands – Mastering the Basics

 


Essential Docker Commands – Mastering the Basics


Mastering Docker commands is essential for efficiently managing containers, images, networks, and volumes. These commands help you interact with Docker and streamline the containerization process.


🌍 Shape Your Future with AI & Infinite Knowledge...!!

🌐 Want to Generate Text-to-Voice, Images & Videos? 👉 http://www.ai.skyinfinitetech.com 📚 Read In-Depth Tech & Self-Improvement Blogs 👉 http://www.skyinfinitetech.com ▶ Watch Life-Changing Videos on YouTube 👉 https://www.youtube.com/@SkyInfinite-Learning 🔥 Transform Your Skills, Business & Productivity – Join Us Today! 🔥



🔹 Basic Docker Commands

1️⃣ Check Docker Version


docker --version

Displays the installed Docker version.


2️⃣ Pull an Image from Docker Hub


docker pull nginx

Downloads an image from the Docker Hub registry.


3️⃣ Run a Container


docker run -d -p 8080:80 nginx

Runs an Nginx container in detached mode (-d) and maps port 8080 on the host to port 80 inside the container.


4️⃣ List Running Containers


docker ps

Shows active containers. Add -a to see all containers (including stopped ones).


5️⃣ Stop a Running Container


docker stop <container_id>

Stops a container gracefully.


6️⃣ Restart a Container


docker restart <container_id>

Restarts a stopped or running container.


7️⃣ Remove a Container


docker rm <container_id>

Deletes a stopped container permanently.


8️⃣ Remove All Stopped Containers


docker container prune

Deletes all stopped containers at once.


9️⃣ Remove an Image


docker rmi <image_name>

Removes an unused image from the system.


10️⃣ List All Docker Images


docker images

Shows all downloaded Docker images.


11️⃣ Check Container Logs


docker logs <container_id>

Displays logs from a running container.


12️⃣ View Running Processes Inside a Container


docker top <container_id>

Shows processes running inside a container.


13️⃣ Execute a Command Inside a Running Container


docker exec -it <container_id> bash

Opens an interactive shell inside a running container.


14️⃣ Copy Files from a Running Container to Host

docker cp <container_id>:/path/to/file /destination/path

Copies files from a container to the host system.


15️⃣ Inspect Detailed Information About a Container


docker inspect <container_id>

Displays low-level information about a container or image.


16️⃣ Check Disk Usage by Docker Objects


docker system df

Shows disk usage of images, containers, and volumes.


17️⃣ Remove Unused Images, Containers, and Networks


docker system prune -a

Cleans up all unused Docker objects, including dangling images.



📢 Next Up: Writing Dockerfiles – Building Custom Images

Comments

Popular posts from this blog

📊 Monitoring & Logging in Kubernetes – Tools like Prometheus, Grafana, and Fluentd

  Monitoring & Logging in Kubernetes – Tools like Prometheus, Grafana, and Fluentd Monitoring and logging are essential for maintaining a healthy and well-performing Kubernetes cluster. In this guide, we’ll cover why monitoring is important, key monitoring tools like Prometheus and Grafana, and logging tools like Fluentd to help you gain visibility into your cluster’s performance and logs. Shape Your Future with AI & Infinite Knowledge...!! Want to Generate Text-to-Voice, Images & Videos? http://www.ai.skyinfinitetech.com Read In-Depth Tech & Self-Improvement Blogs http://www.skyinfinitetech.com Watch Life-Changing Videos on YouTube https://www.youtube.com/@SkyInfinite-Learning Transform Your Skills, Business & Productivity – Join Us Today! 🚀 Introduction In today’s fast-paced cloud-native environment, Kubernetes has emerged as the de-facto container orchestration platform. But deploying and managing applications in Kubernetes is just half the ba...

How to Use SKY TTS: The Complete, Step-by-Step Guide for 2025

 What is SKY TTS? SKY TTS  is a free, next-generation  AI audio creation platform  that brings together high-quality  Text-to-Speech ,  Speech-to-Text , and a full suite of professional  audio editing tools  in one seamless experience. Our vision is simple — to make advanced audio technology  free, accessible, and effortless  for everyone. From creators and educators to podcasters, developers, and businesses, SKY TTS helps users produce  studio-grade voice content  without expensive software or technical skills. With support for  70+ languages, natural voices, audio enhancement, waveform generation, and batch automation , SKY TTS has become a trusted all-in-one toolkit for modern digital audio workflows. Why Choose SKY TTS? Instant Conversion:  Enjoy rapid text-to-speech generation, even with large documents. Advanced Voice Settings:   Adjust speed, pitch, and style for a personalized listening experience. Multi-...

Introduction to Terraform – The Future of Infrastructure as Code

  Introduction to Terraform – The Future of Infrastructure as Code In today’s fast-paced DevOps world, managing infrastructure manually is outdated . This is where Terraform comes in—a powerful Infrastructure as Code (IaC) tool that allows you to define, provision, and manage cloud infrastructure efficiently . Whether you're working with AWS, Azure, Google Cloud, or on-premises servers , Terraform provides a declarative, automation-first approach to infrastructure deployment. Shape Your Future with AI & Infinite Knowledge...!! Read In-Depth Tech & Self-Improvement Blogs http://www.skyinfinitetech.com Watch Life-Changing Videos on YouTube https://www.youtube.com/@SkyInfinite-Learning Transform Your Skills, Business & Productivity – Join Us Today! In today’s digital-first world, agility and automation are no longer optional—they’re essential. Companies across the globe are rapidly shifting their operations to the cloud to keep up with the pace of innovatio...