Challenge 2: Write a Backup Command — Possible Solution ==================================================================== docker run --rm \ -v uploads-data:/data \ -v $(pwd)/backup:/backup \ alpine tar czf /backup/uploads-data-$(date +%Y%m%d).tar.gz /data WHY THIS WORKS AS AN ANSWER ------------------------------ -v uploads-data:/data mounts the named volume being backed up (uploads-data) into a temporary container at /data — this is the volume's actual data, accessible for reading now. -v $(pwd)/backup:/backup mounts a directory on the HOST (the current directory's backup subfolder) into the same temporary container at /backup — this is where the resulting archive file will actually land, outside the ephemeral container so it survives after the container exits. alpine is used as a minimal, disposable image just to run one command — tar czf — that compresses the volume's contents (/data) into an archive written to the host-mounted /backup path. $(date +%Y%m%d) generates today's date as part of the filename, satisfying the "named with today's date" requirement — e.g. uploads-data-20260707.tar.gz. --rm ensures this temporary backup container is automatically removed once the tar command finishes, since it only ever existed to perform this one backup operation and has no reason to persist afterward.