0
0
Dockerdevops~10 mins

Backup and restore strategies in Docker - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to create a backup of a Docker volume named 'data_volume'.

Docker
docker run --rm -v data_volume:/data -v $(pwd):/backup busybox tar [1] -cvf /backup/data_backup.tar /data
Drag options to blanks, or click blank then click option'
A-tvf
B-cvf
C-xvf
D-rvf
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-xvf' which extracts instead of creating an archive.
Using '-tvf' which only lists contents of an archive.
2fill in blank
medium

Complete the command to restore a Docker volume from a backup file named 'data_backup.tar'.

Docker
docker run --rm -v data_volume:/data -v $(pwd):/backup busybox tar [1] -xvf /backup/data_backup.tar -C /data
Drag options to blanks, or click blank then click option'
A-tvf
B-rvf
C-xvf
D-cvf
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-cvf' which creates an archive instead of extracting.
Using '-tvf' which only lists contents of an archive.
3fill in blank
hard

Fix the error in the command to backup a Docker container's filesystem to a tar file.

Docker
docker export [1] > container_backup.tar
Drag options to blanks, or click blank then click option'
Acontainer_id
Bcontainer_name
Cimage_name
Dvolume_name
Attempts:
3 left
💡 Hint
Common Mistakes
Using image name instead of container ID or name.
Using volume name which is invalid for export.
4fill in blank
hard

Fill the blank to create a backup of a Docker volume named 'app_data' into a compressed tar file.

Docker
docker run --rm -v app_data:/data -v $(pwd):/backup busybox tar [1] -czvf /backup/app_data_backup.tar.gz /data
Drag options to blanks, or click blank then click option'
A-tvf
B-xvf
C-cvf
D-czvf
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-cvf' which creates an uncompressed archive.
Using extract or list options instead of create and compress.
5fill in blank
hard

Fill both blanks to restore a compressed backup 'app_data_backup.tar.gz' into a Docker volume named 'app_data'.

Docker
docker run --rm -v app_data:/data -v $(pwd):/backup busybox tar [1] -xzvf /backup/app_data_backup.tar.gz -C [2]
Drag options to blanks, or click blank then click option'
A-xzvf
B-xvf
C/data
D/backup
Attempts:
3 left
💡 Hint
Common Mistakes
Using create options instead of extract.
Using wrong target directory for extraction.