dev-resources.site
for different kinds of informations.
TOP 10 TYPES OF DOCKER COMMANDS
Published at
1/13/2025
Categories
docker
devops
development
containers
Author
aadarsh-nagrath
Author
15 person written this
aadarsh-nagrath
open
Important Docker Commands -
1. Docker Installation and Version
-
docker --version
β Displays the installed Docker version. -
docker info
β Provides detailed information about the Docker installation.
2. Container Management
-
docker run <image>
β Creates and starts a container from an image. -
docker run -d <image>
β Runs a container in detached mode (in the background). -
docker run -it <image>
β Runs a container interactively with a terminal. -
docker ps
β Lists all running containers. -
docker ps -a
β Lists all containers (running and stopped). -
docker stop <container_id>
β Stops a running container. -
docker start <container_id>
β Starts a stopped container. -
docker restart <container_id>
β Restarts a container. -
docker pause <container_id>
β Pauses a running container. -
docker unpause <container_id>
β Unpauses a paused container. -
docker exec -it <container_id> <command>
β Executes a command in a running container (e.g.,docker exec -it <container_id> bash
). -
docker attach <container_id>
β Attaches to a running container. -
docker rm <container_id>
β Removes a container. -
docker logs <container_id>
β Shows the logs of a container. -
docker inspect <container_id>
β Provides detailed information about a container.
3. Image Management
-
docker images
β Lists all available images on your local machine. -
docker pull <image>
β Pulls an image from a Docker registry (e.g., Docker Hub). -
docker build -t <image_name>:<tag> <path>
β Builds a Docker image from a Dockerfile. -
docker rmi <image_id>
β Removes an image. -
docker tag <image_id> <new_image_name>
β Tags an image with a new name. -
docker push <image>
β Pushes an image to a Docker registry (e.g., Docker Hub).
4. Networking
-
docker network ls
β Lists all Docker networks. -
docker network inspect <network_name>
β Displays detailed information about a Docker network. -
docker network create <network_name>
β Creates a new Docker network. -
docker network connect <network_name> <container_name>
β Connects a container to a network. -
docker network disconnect <network_name> <container_name>
β Disconnects a container from a network.
5. Volume Management
-
docker volume ls
β Lists all volumes. -
docker volume create <volume_name>
β Creates a new volume. -
docker volume inspect <volume_name>
β Displays detailed information about a volume. -
docker volume rm <volume_name>
β Removes a volume.
6. Docker Compose
-
docker-compose up
β Starts all services defined in thedocker-compose.yml
file. -
docker-compose up -d
β Starts all services in detached mode. -
docker-compose down
β Stops and removes all containers, networks, and volumes defined in thedocker-compose.yml
file. -
docker-compose logs
β Displays logs for all services. -
docker-compose ps
β Lists the status of containers managed by Docker Compose.
7. System Cleanup
-
docker system prune
β Removes unused data (containers, images, networks, and volumes). -
docker container prune
β Removes all stopped containers. -
docker image prune
β Removes all unused images. -
docker volume prune
β Removes all unused volumes. -
docker network prune
β Removes all unused networks.
8. Container and Image Searching
-
docker search <image_name>
β Searches for images on Docker Hub.
9. Docker Hub Authentication
-
docker login
β Logs in to Docker Hub. -
docker logout
β Logs out from Docker Hub.
10. Docker Info and Performance
-
docker stats
β Displays real-time statistics for containers. -
docker top <container_id>
β Displays the running processes of a container. -
docker diff <container_id>
β Shows the changes made to the container's filesystem.
These commands cover a wide range of Docker functionalities and will help with container, image, volume, and network management.
containers Article's
30 articles in total
Nextcloud on Raspberry Pi - Fedora + Podman Quadlets
read article
AIOpsΒ : Investigation par lβIA dans Kubernetes avec HolmesGPT, Ollama et RunPodΒ β¦
read article
TOP 10 TYPES OF DOCKER COMMANDS
currently reading
Build Faster and Smarter with Containerized Development Environments
read article
Pods in Kubernetes: Lifecycle, Networking, and the Role of Sidecars.
read article
Desplegar un contenedor de Docker desde Azure Container Registry en una WebApp
read article
Containerizing a Django Web Application: Serving Static Pages with Docker
read article
Exploring Docker: The Revolutionary Tool for Modern Application Development
read article
Por que usar Docker?
read article
Podman 3 and Docker Compose - How Does the Dockerless Compose Work?
read article
Setting Up an NGINX Reverse Proxy with a Node.js Cluster Using Docker
read article
AWS ECR Made Easy: Securely Store and Manage Your Container Images
read article
Docker Hands-on: Learn Dockerfile, Container, Port Forwarding with Sample Flask Project
read article
How to create efficient containers
read article
How to create efficient container
read article
How to create effesient container
read article
Containerization Starter Kit: Basics, History, and Key Technologies
read article
π Docker Images Cheat Sheet π
read article
Docker
read article
Scaling Made Simple: How Kubernetes Manages Workloads in the Cloud
read article
Rootless Containers: What They Are and Why You Should Use Them
read article
docker
read article
Exploring Kubernetes: A Step Ahead of Basics
read article
βΈοΈ Kubernetes Architecture Deep Dive: Understanding the Control Plane and Worker Nodes
read article
Kubernetes for Beginners: Making Sense of Container Orchestration in DevOps π
read article
Building Your First Container with a HelloWorld Image using Docker CLI
read article
First Post: Want to great you by this insightful article about Docker History
read article
Understanding Kubernetes Volume Types (EmptyDir, ConfigMap, Secret, HostPath)
read article
Building a Kubernetes Operator: A Practical Guide
read article
Tackling CPU Throttling in Kubernetes for Better Application Performance
read article
Featured ones: