Challenge - 5 Problems
Named Volume Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
Output of Docker volume creation command
What is the output when you run the command to create a named volume called
mydata?Docker
docker volume create mydataAttempts:
2 left
💡 Hint
The command returns the volume name if successful.
✗ Incorrect
The
docker volume create command returns the name of the created volume, which is mydata in this case.🧠 Conceptual
intermediate1:30remaining
Purpose of named volumes in Docker
Which option best describes the main purpose of using named volumes in Docker?
Attempts:
2 left
💡 Hint
Think about data persistence and sharing.
✗ Incorrect
Named volumes allow containers to share data and keep it even if containers are removed, unlike anonymous or bind mounts.
❓ Configuration
advanced2:00remaining
Correct Docker Compose volume syntax
Which Docker Compose snippet correctly defines a named volume
shared_data and mounts it to /app/data inside the container?Attempts:
2 left
💡 Hint
Remember the order is
volume_name:container_path and volumes must be declared at root.✗ Incorrect
Option C correctly declares the named volume under
volumes and mounts it inside the service under volumes with the syntax shared_data:/app/data.❓ Troubleshoot
advanced2:00remaining
Troubleshooting volume data persistence issue
A developer notices that data written inside a container to a named volume is lost after the container is removed and recreated. What is the most likely cause?
Attempts:
2 left
💡 Hint
Check if the volume is actually connected to the container.
✗ Incorrect
If the container does not mount the named volume, data is stored inside the container's writable layer and lost when the container is removed.
🔀 Workflow
expert2:30remaining
Order of commands to share data using named volumes
Arrange the steps in the correct order to share data between two containers using a named volume.
Attempts:
2 left
💡 Hint
You must create the volume before using it in containers.
✗ Incorrect
First create the volume, then start the first container mounting it, write data, and finally start the second container mounting the same volume to share data.