🚀 Essential Docker Commands for DevOps Engineers 🐳
📌 Docker Basics:
- docker --version: Check Docker version.
- docker info: Get system-wide information.
- docker help: Get help with Docker commands.
📌 Container Lifecycle:
- docker run [OPTIONS] IMAGE [COMMAND] [ARG...]: Run a container.
- docker ps: List running containers.
- docker ps -a: List all containers.
- docker stop CONTAINER: Stop a running container.
- docker start CONTAINER: Start a stopped container.
- docker restart CONTAINER: Restart a container.
- docker rm CONTAINER: Remove a container.
- docker kill CONTAINER: Kill a running container.
📌 Images:
- docker images: List images.
- docker pull IMAGE: Pull an image from a registry.
- docker build -t TAG .: Build an image from a Dockerfile.
- docker rmi IMAGE: Remove an image.
📌 Networking:
- docker network ls: List networks.
- docker network create NETWORK: Create a network.
- docker network connect NETWORK CONTAINER: Connect a container to a network.
- docker network disconnect NETWORK CONTAINER: Disconnect a container from a network.
📌 Volumes:
- docker volume ls: List volumes.
- docker volume create VOLUME: Create a volume.
- docker volume rm VOLUME: Remove a volume.
📌 Docker Compose:
- docker-compose up: Start services defined in a Compose file.
- docker-compose down: Stop services defined in a Compose file.
- docker-compose build: Build or rebuild services.
- docker-compose logs: View output from services.
📌 Inspect & Logs:
- docker inspect CONTAINER/IMAGE: Display detailed information.
- docker logs CONTAINER: Fetch the logs of a container.
- docker exec -it CONTAINER bash: Access a running container.
Stay efficient and automate smartly! 💪
⚡️ 𝗙𝗼𝗹𝗹𝗼𝘄 @prodevopsguy 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐬𝐮𝐜𝐡 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 𝐚𝐫𝐨𝐮𝐧𝐝 𝐜𝐥𝐨𝐮𝐝 & 𝐃𝐞𝐯𝐎𝐩𝐬!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs
📌 Docker Basics:
- docker --version: Check Docker version.
- docker info: Get system-wide information.
- docker help: Get help with Docker commands.
📌 Container Lifecycle:
- docker run [OPTIONS] IMAGE [COMMAND] [ARG...]: Run a container.
- docker ps: List running containers.
- docker ps -a: List all containers.
- docker stop CONTAINER: Stop a running container.
- docker start CONTAINER: Start a stopped container.
- docker restart CONTAINER: Restart a container.
- docker rm CONTAINER: Remove a container.
- docker kill CONTAINER: Kill a running container.
📌 Images:
- docker images: List images.
- docker pull IMAGE: Pull an image from a registry.
- docker build -t TAG .: Build an image from a Dockerfile.
- docker rmi IMAGE: Remove an image.
📌 Networking:
- docker network ls: List networks.
- docker network create NETWORK: Create a network.
- docker network connect NETWORK CONTAINER: Connect a container to a network.
- docker network disconnect NETWORK CONTAINER: Disconnect a container from a network.
📌 Volumes:
- docker volume ls: List volumes.
- docker volume create VOLUME: Create a volume.
- docker volume rm VOLUME: Remove a volume.
📌 Docker Compose:
- docker-compose up: Start services defined in a Compose file.
- docker-compose down: Stop services defined in a Compose file.
- docker-compose build: Build or rebuild services.
- docker-compose logs: View output from services.
📌 Inspect & Logs:
- docker inspect CONTAINER/IMAGE: Display detailed information.
- docker logs CONTAINER: Fetch the logs of a container.
- docker exec -it CONTAINER bash: Access a running container.
Stay efficient and automate smartly! 💪
⚡️ 𝗙𝗼𝗹𝗹𝗼𝘄 @prodevopsguy 𝐟𝐨𝐫 𝐦𝐨𝐫𝐞 𝐬𝐮𝐜𝐡 𝐜𝐨𝐧𝐭𝐞𝐧𝐭 𝐚𝐫𝐨𝐮𝐧𝐝 𝐜𝐥𝐨𝐮𝐝 & 𝐃𝐞𝐯𝐎𝐩𝐬!!! // 𝐉𝐨𝐢𝐧 𝐟𝐨𝐫 𝐃𝐞𝐯𝐎𝐩𝐬 𝐃𝐎𝐂𝐬: @devopsdocs