Docker bind mounts
The second option you can use to provide persistent data to a container is called a bind mount. Overall, volumes and bind mounts may look similar; both use the local host's filesystem, and both are mounted using the docker -v
option. While they do share many of the same characteristics, a bind mount differs from a volume mount in one main area: it is not managed by Docker.
Unlike a Docker volume, a bind mount cannot be created by Docker. You cannot create a bind mount using the docker volume create
option; however, a bind mount can be created automatically by Docker when a container starts. Even though Docker can create the bind mount location on the host, it does not "manage" the mount.
Since Docker does not manage the bind mounts, they cannot be deleted using a Docker command. Docker does not track the location of bind mounts in a list. If you create bind mounts in different areas of the filesystem on the host, you need to track the location...