- Beginner
- Containers and images
How it works
An image is a stack of layers plus a configuration: CMD, ENTRYPOINT, ENV, USER, WORKDIR and exposed ports. It is identified by a hash of its content, its ID, and can carry several names (tags). docker pull only downloads the layers the server does not already have.
What breaks
An image never changes once built. Editing a source file does nothing to the running container until you rebuild the image and recreate the container from it, a step people often forget.
In a terminal
docker pull redis:7-alpine
docker images
docker image inspect -f '{{.Config.Cmd}}' redis:7-alpine
See it break, then fix it
Write the Dockerfile or the compose file, type the docker commands, and watch a simulated server run them through reboots, upgrades and traffic. Free to start.