Challenge - 5 Problems
Docker Backup & Restore Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Backup a Docker volume using a container
What is the output of the following command sequence to backup a Docker volume named
mydata into a tar file?Docker
docker run --rm -v mydata:/data -v $(pwd):/backup alpine tar czf /backup/mydata_backup.tar.gz -C /data . docker run --rm -v $(pwd):/backup alpine ls /backup
Attempts:
2 left
💡 Hint
Check the tar file name specified in the command.
✗ Incorrect
The tar file is named
mydata_backup.tar.gz as specified in the tar command inside the container.🧠 Conceptual
intermediate2:00remaining
Choosing backup strategy for Docker containers
Which backup strategy is best to ensure data persistence for a database running inside a Docker container?
Attempts:
2 left
💡 Hint
Think about where the database stores its data persistently.
✗ Incorrect
Backing up the database data directory stored in a Docker volume ensures the actual data is saved. Container filesystem or image backups do not guarantee data consistency.
❓ Troubleshoot
advanced2:00remaining
Restore failure from Docker volume backup
You restored a Docker volume backup using the command
docker run --rm -v mydata:/data -v $(pwd):/backup alpine tar xzf /backup/mydata_backup.tar.gz -C /data but the application cannot read the data. What is the most likely cause?Attempts:
2 left
💡 Hint
Consider what happens to file permissions when extracting tar archives inside containers.
✗ Incorrect
Tar extraction inside a container may not preserve original file ownership and permissions, causing the application to fail reading data.
🔀 Workflow
advanced2:00remaining
Automated backup workflow for Docker volumes
Which sequence of commands correctly automates backing up a Docker volume
appdata daily to a timestamped file in /backups directory on the host?Attempts:
2 left
💡 Hint
Check volume mounting and tar command correctness.
✗ Incorrect
Option D correctly mounts the volume and host backup directory, creates the backup file with date, and ensures the backup directory exists.
✅ Best Practice
expert3:00remaining
Best practice for restoring Docker container state with minimal downtime
What is the best practice to restore a Docker container's data volume and minimize downtime in a production environment?
Attempts:
2 left
💡 Hint
Consider how to avoid data loss and downtime during restore.
✗ Incorrect
Creating a new volume and restoring backup there allows testing and switching volumes with minimal downtime and risk.