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.
docker Article's
30 articles in total
Building bun-tastic: A Fast, High-Performance Static Site Server (OSS)
read article
Day 04: Docker Compose: Managing multi-container applications
read article
Infraestrutura para anΓ‘lise de dados com Jupyter, Cassandra, Pyspark e Docker
read article
Building RelaxTube: A Scalable Video Transcoding and Streaming Application
read article
Docker vs kubernetes
read article
Advanced Docker Concepts and Features
read article
Building and Deploying Your First Java App with Docker in Just 5 Minutes
read article
Realtime troubleshooting based questions docker compose
read article
common Docker Compose interview questions.
read article
[Boost]
read article
Docker scenario
read article
TOP 10 TYPES OF DOCKER COMMANDS
currently reading
how to inspect a docker container
read article
How to run a Nginx-web server
read article
Docker article Best
read article
Load Balancing Node.js Applications with Nginx Upstream Configuration
read article
Top 20 Docker Commands with Examples and Outputs
read article
π Deploying a Live Project Without a Dockerfile Using Buildpacks π
read article
A Conversation with Docker CTO Justin Cormack and Flux CEO Ron Efrani: The Future of Developer Environments
read article
Understanding Node.js Alpine Versions: A Lightweight Choice for Your Projects
read article
Day 03: Docker Images and Containers: Building, Pulling, and Running Docker Containers
read article
How would you optimize the performance of Docker containers, particularly in resource-constrained environments ?
read article
Docker in development: Episode 4
read article
Building a Local S3 Environment with MinIO: AWS SDK for Java V2 Migration Guide
read article
Node.js Meets PostgreSQL and MongoDB in Docker: Docker Diaries
read article
How to Use Docker in Your Data Science Projects: A Complete Guide
read article
Bringing Together Containers & SQL
read article
π Are Your Docker Containers Secure? π‘οΈ In this article, learn 10 actionable strategies to protect your Docker containers like a pro
read article
Running PostgreSQL, MongoDB, and NestJS concurrently with Docker Compose
read article
Creando un notebook con Jupyter y Kotlin
read article
Featured ones: