Skip to content
Advertisement

Docker bind source path does not exist even though it does

I have two ubuntu server VMs running on the same proxmox server. Both are running docker. I want to migrate one container from one of the VMs to the other. For that I need to attach a USB drive to the target VM which will be mounted inside the docker container. I mounted the drive exactly the same way in both VMs (the old one is shut down of course) and the mounting works, I can access the directory and see the contents of the drive. Now I want to run the container with the exact same command as I used on the old vm which looks something like this: docker run -d –restart unless-stopped –stop-timeout 300 -p 8081:8081 –mount type=bind,source=”/data”,destination=/internal_data

This works in the old VM, but on the new one it says: docker: Error response from daemon: invalid mount config for type “bind”: bind source path does not exist: /data. See ‘docker run –help’.

I don’t understand what’s wrong. /data exists and is owned by root, the same as it is on the old VM. In fact, it’s the same drive with the same contents. If I shut down the new VM and boot up the old one with the drive mounted in exactly the same way, it just works.

What can cause this error, if the source path does in fact exist?

Advertisement

Answer

I fixed it by mounting the drive in a mount point in /mnt/. I changed nothing else and in the other VM it works when mounting on the root with the same user and permissions. No idea why that fixed it.

Advertisement