0
0
Dockerdevops~10 mins

Debugging volume mount issues 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 mount a local directory /data to /app/data inside the container.

Docker
docker run -v [1]:/app/data myimage
Drag options to blanks, or click blank then click option'
A/data
B/app/data
C/data/app
D/app
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping the local and container paths.
Using a container path as the local path.
2fill in blank
medium

Complete the command to run a container with a read-only volume mount of /config directory.

Docker
docker run -v /config:/app/config:[1] myimage
Drag options to blanks, or click blank then click option'
Areadwrite
Bro
Crw
Dreadonly
Attempts:
3 left
💡 Hint
Common Mistakes
Using readonly instead of ro.
Forgetting the colon before the option.
3fill in blank
hard

Fix the error in the command to mount a host directory /var/logs to /logs inside the container.

Docker
docker run -v [1] myimage
Drag options to blanks, or click blank then click option'
A/var/logs
B/logs:/var/logs
C/var:/logs
D/var/logs:/logs
Attempts:
3 left
💡 Hint
Common Mistakes
Missing the colon separator.
Swapping host and container paths.
4fill in blank
hard

Fill both blanks to create a volume mount that maps /home/user/data on the host to /data in the container with read-write access.

Docker
docker run -v [1]:[2] myimage
Drag options to blanks, or click blank then click option'
A/home/user/data
B/data
Crw
Dro
Attempts:
3 left
💡 Hint
Common Mistakes
Adding read-write option explicitly when not needed.
Swapping the host and container paths.
5fill in blank
hard

Fill all three blanks to create a volume mount with /opt/config on the host mapped to /app/config in the container as read-only.

Docker
docker run -v [1]:[2]:[3] myimage
Drag options to blanks, or click blank then click option'
A/opt/config
B/app/config
Cro
Drw
Attempts:
3 left
💡 Hint
Common Mistakes
Using rw instead of ro for read-only mount.
Swapping host and container paths.