# Exercise 1 — Observe Layers Directly
#
# STEP 1: Complete the Dockerfile below (replace each TODO). It intentionally
#         creates one instruction per layer-worthy change so you can inspect
#         them individually afterward.
# STEP 2: Build it:  docker build -t layers-lab -f docker_images_and_containers_exercise_1.Dockerfile .
# STEP 3: Run `docker history layers-lab` and match each row to the
#         instruction that produced it.
# STEP 4: Run a container from it, modify a file that came from a lower
#         layer, then run `docker diff <container>` to see copy-on-write
#         happen in real time.
#
# There is no code self-check for a Dockerfile (no interpreter to assert
# against) — instead, verify your finished file against the CHECKLIST at
# the bottom before considering this done.

# TODO 1: base image — use alpine:3.19 explicitly (not `latest`)
FROM TODO

# TODO 2: create a working directory /app and make it the default for
#         subsequent instructions (one instruction, does both)
TODO

# TODO 3: write the literal text "layer three" into /app/notes.txt using a
#         RUN instruction with a shell redirect (this is its own layer)
TODO

# TODO 4: append the literal text "layer four" as a NEW line onto the same
#         /app/notes.txt using a second, separate RUN instruction (so it is
#         a DIFFERENT layer from TODO 3, even though it touches the same file)
TODO

# TODO 5: set an environment variable NOTES_PATH=/app/notes.txt
TODO

# TODO 6: default command — cat the notes file when the container starts
TODO

# ---------------------------------------------------------------------------
# CHECKLIST — your finished Dockerfile must satisfy ALL of these:
#
# [ ] Builds successfully with `docker build -t layers-lab -f <this file> .`
# [ ] `docker run --rm layers-lab` prints both "layer three" and
#     "layer four", each on its own line, in that order.
# [ ] `docker history layers-lab` shows a SEPARATE row for the TODO-3 RUN
#     and the TODO-4 RUN — i.e. writing to notes.txt twice produced two
#     distinct layers, not one merged layer.
# [ ] The base image line pins an explicit tag (`alpine:3.19`), not `latest`.
# [ ] Running `docker run --rm layers-lab sh -c "echo appended >> /app/notes.txt"`
#     followed by `docker run --rm layers-lab cat /app/notes.txt` in a FRESH
#     container still shows only "layer three" / "layer four" — proving the
#     earlier container's copy-on-write edit never touched the image itself.
# ---------------------------------------------------------------------------
