Docker basics: Images & Containers
DEVA KARZ
0:00 / 0:00
Docker basics: Images & Containers
4 просмотра · 2 нед. назад
DEVA KARZ
12 подписчиков
4 просмотра · 2 нед. назад
In this video, we cover the absolute essentials of Docker! If you are a beginner looking to understand how Docker works, how to run containers in the foreground vs. background, how to manage Nginx, and how to enter an interactive container shell (-it), this step-by-step tutorial is for you.
We start from checking the version, fixing port conflicts by stopping local services, managing container logs, and exploring the internal file system of Ubuntu and Nginx containers.
📌 What You Will Learn in This Video:
Running Nginx in the foreground vs. detached (background) mode using -d
Stopping containers using short Container IDs or names
Troubleshooting port 80 conflicts with systemctl stop nginx
Inspecting container logs using docker logs
Accessing a container's terminal interactively with -it and bash
⏱️ Timestamps:
00:00 - Introduction & Checking Docker Version
01:15 - Resolving Port Conflicts (systemctl stop nginx)
02:30 - Running Nginx in Foreground vs. Background (-d)
04:45 - Listing & Stopping Running Containers (docker ps & docker stop)
06:15 - Checking Container Logs (docker logs)
07:40 - Interactive Mode: Exploring Nginx File System (-it bash)
09:55 - Interactive Mode: Creating Folders inside an Ubuntu Container
11:30 - Conclusion & Next Steps
💻 Commands Used in This Video:
Check version
docker --version
Stop local Nginx to free up Port 80
sudo systemctl status nginx
sudo systemctl stop nginx
Run container in foreground (stops with Ctrl+C)
docker run --rm -p 80:80 nginx
Run container in background (Detached mode)
docker run --rm -dp 80:80 --name webhost nginx
List running containers
docker ps
Stop container using first 4 digits of ID or Name
docker stop ef2d
docker stop webhost
View container logs
docker logs webhost
Interactive shell inside Nginx container
docker run -it --rm -p 80:80 --name webhost nginx bash
Interactive shell inside Ubuntu container
docker run -it --rm -p 80:80 --name ubuntu ubuntu
🔔 Don't forget to Like, Share, and Subscribe for more DevOps tutorials!
#docker #devops #dockercontainers #nginx #ubuntu #linuxcommands #techtutorial #programming #backenddevelopment #learndocker