You want to store database data persistently in Docker. Which option best explains when to use a Docker volume instead of a bind mount?
Think about who controls the data location and portability.
Docker volumes are managed by Docker and stored in a Docker-controlled location, making them portable and easier to backup. Bind mounts link directly to host directories, which can be less portable and more dependent on host paths.
What is the output type of the command docker volume inspect my_volume?
docker volume inspect my_volumeThink about what 'inspect' commands usually return in Docker.
The docker volume inspect command returns detailed information about the volume in JSON format, including its mountpoint and driver details.
Arrange the steps in the correct order to create a Docker volume and use it in a container.
Think about listing volumes before and after creation, and when to remove.
First, create the volume, then list volumes to see it, run the container using it, and finally remove the volume when no longer needed.
You mounted a host directory into a container using a bind mount, but the container process cannot write to the directory. What is the most likely cause?
Consider how host filesystem permissions affect bind mounts.
Bind mounts use the host directory directly, so if the host directory permissions do not allow writing by the container user, the container cannot write to it.
You want to share configuration files between your host and a Docker container, allowing live edits on the host to reflect immediately inside the container. Which is the best approach?
Think about live updates and direct file access.
Bind mounts allow the container to access the exact files on the host, so changes on the host are immediately visible inside the container without rebuilding or copying.