DevCloud Ninjas Tech Community: post #221 โ€” TG.ME

๐Ÿš€ 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!
๐Ÿ’ช


โšก๏ธ ๐—™๐—ผ๐—น๐—น๐—ผ๐˜„ @devcloudninjas ๐Ÿ๐จ๐ซ ๐ฆ๐จ๐ซ๐ž ๐ฌ๐ฎ๐œ๐ก ๐œ๐จ๐ง๐ญ๐ž๐ง๐ญ ๐š๐ซ๐จ๐ฎ๐ง๐ ๐œ๐ฅ๐จ๐ฎ๐ & ๐ƒ๐ž๐ฏ๐Ž๐ฉ๐ฌ!!! // ๐‰๐จ๐ข๐ง ๐Ÿ๐จ๐ซ ๐ƒ๐ž๐ฏ๐Ž๐ฉ๐ฌ ๐ƒ๐Ž๐‚๐ฌ: @devcloudninjas
๐Ÿ‘1
October 22, 2024 741 3 6