2

I have a VirtualBox Guest OS running Ubuntu Server 17.04 which has docker-ce installed. I have some shared folders that are mounted inside the Guest OS but when I pass them to the docker container with a --volume command I can't see any content inside them. Am I doing something wrong here?

sudo docker create --name=plex -v /home/kunal/media/:/media plexinc/pms-docker
Kunal
  • 139
  • 6
  • Can you add the `docker run` command you're using please – samprog Nov 02 '17 at 09:03
  • done, I've added the command. I can pass in any other folder and it works fine but the VirtualBox shares that are mounted (media in this case) show up empty inside the container – Kunal Nov 02 '17 at 09:12
  • Have you tried restarting the docker demon without restarting the entire vm? – BMitch Nov 02 '17 at 09:36
  • Did you enable encrypted home directories on your Ubuntu install? – BMitch Nov 02 '17 at 09:38
  • That did it! thank you @BMitch . Restarting docker daemon fixed the issue which means when I modify or remount the virtualbox shares I would need to restart the service. Can you post this as an answer please so that I can close this thread? – Kunal Nov 02 '17 at 09:48

1 Answers1

1

I've seen an issue before (it may have since been fixed) where docker detects all the mounted filesystems on the host when the daemon starts. If you changed mounted filesystems after starting the daemon, it wouldn't see those filesystems for volume mounts. The workaround is to just bounce the docker daemon (e.g. sudo systemctl restart docker) after making any filesystem changes. You may also want to try newer versions of docker to see if the issue has since been fixed.

BMitch
  • 231,797
  • 42
  • 475
  • 450