Challenge - 5 Problems
Volume Mount Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Volume mount path error output
What error message will Docker show if you try to mount a host directory that does not exist?
Docker
docker run -v /nonexistent/path:/app busybox ls /app
Attempts:
2 left
💡 Hint
Docker checks if the host path exists before starting the container.
✗ Incorrect
Docker requires the host directory to exist before mounting it. If it doesn't, Docker shows an error about invalid mount config and missing source path.
❓ Troubleshoot
intermediate2:00remaining
Container cannot write to mounted volume
You mounted a host directory into a container, but the container process cannot write files inside it. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check the permissions of the host directory and the user inside the container.
✗ Incorrect
If the host directory is owned by root and has no write permission for others, the container user cannot write to it. This is a common cause of write failures.
❓ Configuration
advanced2:00remaining
Correct volume mount syntax in docker-compose
Which docker-compose volume syntax correctly mounts the host directory /data into /app/data inside the container with read-write access?
Attempts:
2 left
💡 Hint
By default, volume mounts are read-write unless specified otherwise.
✗ Incorrect
The syntax '/data:/app/data' mounts the host /data directory into the container path /app/data with read-write access by default. Adding ':rw' is optional but valid.
✅ Best Practice
advanced2:00remaining
Avoiding permission issues with Docker volumes
What is the best practice to avoid permission problems when mounting host directories into Docker containers?
Attempts:
2 left
💡 Hint
Consider Docker-managed storage to avoid host permission conflicts.
✗ Incorrect
Named Docker volumes are managed by Docker and avoid host permission issues because Docker controls the volume's ownership and permissions. This is a best practice for consistent behavior.
🧠 Conceptual
expert2:00remaining
Understanding volume mount propagation modes
Which volume mount propagation mode allows changes in the container's mounted volume to be reflected back to the host and other containers?
Attempts:
2 left
💡 Hint
Propagation modes control how mount events propagate between host and container.
✗ Incorrect
The 'rshared' propagation mode allows mount and unmount events to propagate both ways between the host and container, enabling changes in the container to be visible on the host and other containers.