Top Docker Commands #technology #shorts #docker

preview_player
Показать описание
Docker adoption continues to accelerate, making basic Docker literacy an essential skill for developers, data professionals, QA engineers, and more.

Whether you're a software engineer building microservices, a data scientist packaging models, a QA automating tests, or DevOps architecting pipelines - Docker is now a core competency.

No matter your technical discipline, understanding these fundamental Docker concepts and commands is key:

1. **Setup & Image Management**:
- 🏗️ `docker build -t myapp .` ➡️ Build image from a Dockerfile.
- 📦 `docker pull ubuntu` ➡️ Fetch an image from a registry.
- 📤 `docker push myuser/myapp` ➡️ Store your image remotely.
- 🗂️ `docker images` ➡️ List all local images.
- 📸 `docker rmi image_name` ➡️ Remove an image.
- 🧠 `docker history image_name` ➡️ See layers of an image.
- 📋 `docker tag source_image target_image` ➡️ Tag an image.

2. **Running & Managing Containers**:
- 🚀 `docker run image_name` ➡️ Start a container.
- ⏸️ `docker stop container_id` ➡️ Stop a container.
- 🛑 `docker kill container_id` ➡️ Force stop a container.
- 🔄 `docker restart container_id` ➡️ Restart a container.
- 🔄 `docker rename old_name new_name` ➡️ Rename a container.
- 🔍 `docker logs container_id` ➡️ View container logs.
- 💼 `docker exec -it container_id bash` ➡️ Interact with a running container.
- ⏹️ `docker pause container_id` ➡️ Pause processes in container.
- ▶️ `docker unpause container_id` ➡️ Resume processes in container.

3. **Network & Storage**:
- 🌐 `docker network ls` ➡️ List networks.
- 💽 `docker volume create myvolume` ➡️ Create a volume.
- 💽 `docker volume ls` ➡️ List volumes.

4. **Clean-up & Maintenance**:
- 🧹 `docker system prune` ➡️ Clean up resources.
- 🗑️ `docker rm container_id` ➡️ Delete a stopped container.
- 🧠 `docker inspect container_id` ➡️ Container details.
- 🛠️ `docker stats` ➡️ Real-time container stats.
- 📋 `docker ps` ➡️ List running containers.
- 📜 `docker ps -a` ➡️ List all containers.

5. **Docker Compose (Multiple Containers)**:
- 📑 `docker-compose up` ➡️ Start multi-container app.
- ⏸️ `docker-compose stop` ➡️ Stop services.
- 🗑️ `docker-compose down` ➡️ Stop and remove resources.
- 🛠️ `docker-compose logs` ➡️ View logs.
- 🔄 `docker-compose restart` ➡️ Restart services.

6. **Advanced Utilities & Miscellaneous**:
- 📁 `docker cp container_id:/path` ➡️ Copy files from container.
- 📖 `docker diff container_id` ➡️ Changes to container's FS.
- 🧠 `docker top container_id` ➡️ Running processes in container.
- 📜 `docker search term` ➡️ Search Docker Hub for images.
- 🚪 `docker port container_id` ➡️ Public ports for container.
- 🌍 `docker login` ➡️ Log in to Docker Hub.
- 🚪 `docker logout` ➡️ Log out from Docker Hub.
Рекомендации по теме