Got the fundamentals? A structured Docker course is a fast way to level up.
Find Docker courses on UdemyAffiliate link. Costs you nothing extra.
- 01Getting Started
- 02What Is Docker?
- 03Checking the Version with docker --version
- 04Images vs. Containers
- 05Fetching an Image with docker pull
- 06Listing Images with docker images
- 07Starting a Container with docker run
- 08Running in the Background with docker run -d
- 09Listing Running Containers with docker ps
- 10Listing Every Container with docker ps -a
- 11Naming a Container with docker run --name
- 12Stopping a Container with docker stop
- 13Restarting a Stopped Container with docker start
- 14Restarting with docker restart
- 15Deleting a Container with docker rm
- 16Deleting an Image with docker rmi
- 17Publishing a Port with docker run -p
- 18Passing Environment Variables with docker run -e
- 19Mounting a Volume with docker run -v
- 20Running Commands Inside a Container with docker exec
- 21Reading Logs with docker logs
- 22Inspecting Details with docker inspect
- 23Viewing Processes with docker top
- 24Monitoring Resources with docker stats
- 25Copying Files with docker cp
- 26What Is a Dockerfile?
- 27Choosing a Base Image with FROM
- 28Setting the Working Directory with WORKDIR
- 29Adding Files with COPY
- 30Executing Commands with RUN
- 31Setting the Startup Command with CMD
- 32Declaring Ports with EXPOSE
- 33Building an Image with docker build
- 34Tagging an Image with docker tag
- 35Sharing an Image with docker push
- 36What Is .dockerignore?
- 37What Is a Multi-Stage Build?
- 38Creating a Volume with docker volume create
- 39Listing Volumes with docker volume ls
- 40Creating a Network with docker network create
- 41Listing Networks with docker network ls
- 42What Is Docker Compose?
- 43Starting Everything with docker compose up
- 44Stopping Everything with docker compose down
- 45Cleaning Up with docker system prune
Images vs. Containers
This is the single most important distinction in Docker, and the one beginners most often blur. An image is a read-only template; a container is a running instance created from that image.
Think of the image as a blueprint or a cake mould, and the container as what comes out of it. From one image you can create as many containers as you like, and each runs independently.
Running docker images lists the templates you hold; docker ps lists the containers actually running. Two different commands, because they show two different things.
A common stumble is trying to "start an image" or "delete a running image." You start containers, and you can only delete an image once no container is using it.
In real work, keeping this separation clear is what makes commands like build, run, and rm feel obvious rather than arbitrary.
🧑💻 You can type this command into the Docker pseudo terminal to try it yourself (this page itself has no interactive terminal).
