The two most important concepts in Docker are Image and Container.
• Image is a read-only template containing the file system, dependencies, and instructions needed to run an app. Think of it like a blueprint.
• Container is a running instance based on an image — like a house actually built from that blueprint. You can run many containers from a single image.
dockerfile
# Pull the image first
docker pull nginx
# Create and run a container from that image
docker run --name my-nginx -d -p 8080:80 nginx
# Show running containers
docker psThe first command downloads the nginx image onto your local machine. The second command uses that image to run a container named my-nginx.
You should see
You should see the my-nginx container listed as running in docker ps.Info
An image is an unchanging template, while a container is a running process. Even if you delete the container, the image stays put.