1/20 🐳 Check Docker version: docker --version 📜 Explanation: Check Docker version installed on your system.
@devops_tech who tf does docker container ls instead of docker ps -a
Mastering Docker commands is essential for efficiently managing containers and containerized applications. Here are some fundamental Docker commands to get you started: 1. **Docker Version**: - Check the installed Docker version. ```shell docker --version ``` 2. **Docker Info**: - Get detailed information about your Docker installation. ```shell docker info ``` 3. **Docker Help**: - Get help on Docker commands and usage. ```shell docker --help ``` 4. **Docker Images**: - List all locally available Docker images. ```shell docker images ``` 5. **Docker Pull**: - Download a Docker image from a container registry (e.g., Docker Hub). ```shell docker pull image_name ``` 6. **Docker Run**: - Create and start a container from an image. ```shell docker run image_name ``` 7. **Docker PS**: - List running containers. ```shell docker ps ``` 8. **Docker PS (All)**: - List all containers, including stopped ones. ```shell docker ps -a ``` 9. **Docker Stop**: - Stop a running container. ```shell docker stop container_id ``` 10. **Docker Start**: - Start a stopped container. ```shell docker start container_id ``` 11. **Docker Restart**: - Restart a running or stopped container. ```shell docker restart container_id ``` 12. **Docker Logs**: - View the logs of a container. ```shell docker logs container_id ``` 13. **Docker Exec**: - Run a command inside a running container. ```shell docker exec -it container_id command ``` 14. **Docker Build**: - Build a Docker image from a Dockerfile. ```shell docker build -t image_name Dockerfile_directory ``` 15. **Docker Push**: - Push a locally built image to a container registry. ```shell docker push image_name ``` 16. **Docker Network**: - Manage Docker networks for connecting containers. ```shell docker network create network_name ``` 17. **Docker Volume**: - Manage Docker volumes for persistent data storage. ```shell docker volume create volume_name ``` 18. **Docker Compose**: - Define and run multi-container applications using a Docker Compose file. ```shell docker-compose up -d ``` 19. **Docker Clean-Up**: - Remove all stopped containers, unused images, and volumes. ```shell docker system prune ``` 20. **Docker Stats**: - View real-time resource usage statistics for running containers. ```shell docker stats container_id ``` These are some of the most commonly used Docker commands. As you work with Docker more extensively, you'll discover additional commands and options tailored to your specific use cases. Remember to refer to Docker's official documentation for comprehensive information on each command and its options.