# Guided Exercise: Trace the Counts Through a Sequence of Commands This is a paper exercise — commit to your answer before checking it in the Lab. ## Your task Starting from a completely clean system (no images, no containers), predict the number of IMAGES and the number of CONTAINERS after each step: 1. `docker pull redis:alpine` 2. `docker run -d --name cache1 redis:alpine` 3. `docker run -d --name cache2 redis:alpine` 4. `docker rm -f cache1` 5. `docker rmi redis:alpine` (attempted while `cache2` is still running) ## A worked shape to check yourself against 1. 1 image, 0 containers. 2. 1 image, 1 container. 3. 1 image, 2 containers. 4. 1 image, 1 container (only `cache1` removed). 5. This actually FAILS — Docker refuses to remove an image that a running container (`cache2`) still depends on, specifically to prevent exactly this kind of accident. Still 1 image, 1 container, plus an error message. ## Instructor Notes **Facilitation:** Item 5 is the most valuable one — many students haven't seen Docker's dependency-protection behavior yet, and it's a good real safety feature to highlight. **Approximate timing:** 8-10 minutes live discussion; 5 minutes self-paced.