Day 20 Task: Docker Cheat sheet

Day 20 Task: Docker Cheat sheet

🔶 Docker container

docker version: To check the docker version

docker ps: The list of containers started

docker ps -a: A list of all containers started

docker login <repository>: Connects to a remote repository

docker pull <image-name>: Extracts the image from the repository

docker push <image-name>: Push the image to the remote repository

docker run: Create and start a new container

docker rm <container-id>: Remove container

docker kill or stop <container-id>: Stop container

docker exec: Execute a command inside a running container.

docker logs: View logs from a container

docker stats: Display a live stream of container resource usage

🔶 Docker image

docker images: List available images

docker rmi <image>: Delete image

docker build -t <image-name>: Build an image from "dockerfile"

docker image prune: Remove all unused images

🔶 Docker compose

docker-compose up: Start containers defined in a docker-compose.yml

docker-compose up -d: Start the container in detach mode

docker-compose down: Stop container defined in a docker-compose.yml

docker-compose build: Build docker images defined in docker-compose.yml

docker-compose stop: Stop container started by docker-compose up

docker-compose ps: List container defined in a docker-compose.yml

docker-compose logs: View all logs defined in a docker-compose.yml

🔶 Docker Volume

docker volume ls: List of volume

docker volume create: Create a volume

docker volume inspect: Display volume details

docker volume rm: Remove a volume

docker volume prune: Remove unused volume

🔶Docker Network

docker network ls: List of networks

docker network create: Create a network

docker network inspect: Display network details

docker network rm: Remove a network

docker network prune: Remove unused network

In conclusion, a Docker cheat sheet serves as an invaluable resource for both beginners and experienced users of Docker. It condenses essential commands, concepts, and best practices into a concise and easily accessible format, streamlining the process of working with containers.

Stay in the loop with my latest insights and articles on cloud ☁️ and DevOps ♾️ by following me on Hashnode, LinkedIn (https://www.linkedin.com/in/chandreshpatle28/), and GitHub (https://github.com/Chandreshpatle28).

Thank you for reading! Your support means the world to me. Let's keep learning, growing, and making a positive impact in the tech world together.

#Git #Linux Devops #Devopscommunity #90daysofdevopschallenge #python #docker

Did you find this article valuable?

Support CHANDRESH PATLE by becoming a sponsor. Any amount is appreciated!