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.
development Article's
30 articles in total
Development refers to the process of building, improving, and maintaining software, websites, and systems.
Top 10 Online Postman-Like Tools for API Testing and Development
read article
Singularity: Streamlining Game Development with a Universal Framework
read article
How to develop ecommerce website using WooCommerce plugin?
read article
The Perils of Presumption: Why Making Assumptions in Development is Bad
read article
Introducing the New .NET MAUI Bottom Sheet Control
read article
Solving Circular Dependencies: A Journey to Better Architecture
read article
Aumente seu leque de ferramentas no desenvolvimento com um exemplo prΓ‘tico usando MoSCoW
read article
Top 50 Websites a Backend Developer Must Know π₯οΈπ§π
read article
Moving Apple Music MP3 Playlists To Android
read article
Expanded literacy and the current state of software
read article
Here are 7 Regex tools that can save your life from hell π₯
read article
Level Up Your Architecture Game with Monolithic Modular - It's Not What You Think
read article
How to Fix the βRecord to Delete Does Not Existβ Error in Prisma
read article
How to Enable JavaScript on iPhone
read article
End-to-End API Testing: How Mocking and Debugging Work Together
read article
The first part of this MASSIVE series about software architecture patterns is OUT!! please check it out!!
read article
And... We're Off!
read article
projects and apps
read article
Designing Context for New Modules in HyperGraph
read article
TOP 10 TYPES OF DOCKER COMMANDS
currently reading
Elevate Your Brand with Expert Craft CMS Solutions
read article
Why Facing Your Fears Makes You a Cool (and Confident) Developer
read article
Digital Signage: Your Key to Captivating Customers
read article
π I have released Eurlexa!!! EU Regulation at Your Fingertips!
read article
Master Advanced Techniques in Prompt Engineering Today!
read article
Build Faster and Smarter with Containerized Development Environments
read article
Grow your startup business with TechnBrains App Development.
read article
πββ¬ Git and GitHub: A Beginnerβs Guide to Version Control π
read article
10 Tailwind CSS Dropdowns - Free and Open-Source
read article
Meilleurs proxy anonymes pour le torrent et la confidentialitΓ©
read article
Featured ones: