Home / Interview /Essential Docker Co...
John Doe
2024-07-25
0 mins read
Similar Blogs
DevOps with AWS for Beginners: Core Concepts and Tools
0 mins read
2024-10-18
Introduction to DevOps: What is DevOps, Tools & Principles
0 mins read
2024-08-29
CICD And Its Best Practices
0 mins read
2023-09-07
DevOps a Buzz word or what?
0 mins read
2023-09-13
How do all the automation tools work together in a CICD flow?
0 mins read
2023-09-07
Which is among Puppet, Chef, SaltStack best CM tool
0 mins read
2023-09-07
Difference between Git and SVN - DevOps Interview Question
0 mins read
2023-09-07
What is CI? What is its purpose?
0 mins read
2023-09-07
What is a Docker container? How do you create, start and stop containers?
0 mins read
2023-09-07
Top 20 Jenkins Interview Questions and Answers - 2024
0 mins read
2024-03-22
Docker is a powerful platform for developing, shipping, and running applications using containerization. It allows developers to package applications and their dependencies into containers, ensuring consistency across various environments from development to production. This portability reduces the "it works on my machine" problem, streamlines collaboration, and speeds up deployment cycles. Docker's lightweight and scalable nature makes it ideal for microservices architecture, improving resource utilization and operational efficiency. In today's fast-paced tech landscape, Docker plays a vital role in enabling continuous integration and continuous deployment (CI/CD), simplifying cloud migration, and fostering a robust DevOps culture, ultimately driving innovation and agility in software development.
Here are some frequently used Docker commands or cheat sheet along with brief explanations:
1. docker pull <image>:
- Pulls an image from a registry (e.g., Docker Hub).
2. docker images:
- Lists all images stored locally.
3. docker build -t <image_name> .:
- Builds an image from a Dockerfile in the current directory.
4. docker rmi <image>:
- Removes one or more images.
1. docker run <image>:
- Runs a command in a new container from the specified image.
2. docker ps:
- Lists all running containers.
3. docker ps -a:
- Lists all containers, including stopped ones.
4. docker stop <container>:
- Stops a running container.
5. docker start <container>:
- Starts a stopped container.
6. docker restart <container>:
- Restarts a running or stopped container.
7. docker rm <container>:
- Removes one or more stopped containers.
8. docker exec -it <container> <command>:
- Runs a command in a running container (interactive terminal).
1. docker volume create <volume_name>:
- Creates a new volume.
2. docker volume ls:
- Lists all volumes.
3. docker volume rm <volume_name>:
- Removes one or more volumes.
1. docker network create <network_name>:
- Creates a new network.
2. docker network ls:
- Lists all networks.
3. docker network rm <network_name>:
- Removes one or more networks.
1. docker-compose up:
- Builds, (re)creates, starts, and attaches to containers for a service defined in a docker-compose.yml file.
2. docker-compose down:
- Stops containers and removes containers, networks, volumes, and images created by up.
3. docker-compose build:
- Builds or rebuilds services.
4. docker-compose logs:
- Displays log output from services.
1. docker login:
- Logs in to a Docker registry.
2. docker logout:
- Logs out from a Docker registry.
3. docker info:
- Displays system-wide information about Docker.
These commands cover a wide range of Docker functionalities for managing images, containers, volumes, networks, and more. Feel free to share commands that you’re using, we will add them in this cheat sheet.
INQUIRY
By tapping continuing, you agree to our Privacy Policy and Terms & Conditions
SkillAhead Solutions
Gurgaon
USA
1603, Capitol Avenue, Suite 413A, 2659, Cheyenne, WY 82001, USA
`Copyright © DevLabs Alliance. All rights Reserved`
|
Refund & Reschedule Policy
Privacy Policy
Terms of Use