ContainerSolutions / docker-cobbler

Cobbler in a Docker container
50 stars 29 forks source link

Cannot reflect the changes after the volume is mounted #9

Closed ketank1000 closed 6 years ago

ketank1000 commented 6 years ago

Iam having an issue after mounting a volume to the container. The changes are not been reflected in container. This are the step which I follow

  1. I mount -v /mnt:/mnt while starting the container.
  2. I create subfolder /mnt/test outside container (with all privilages)
  3. Then I extract DVD to this subfolder /mnt/test (cmd: mount -t iso9660 -o loop,ro image.iso /mnt/test)

So the issue is the content in the /mnt/test are not reflected in the container. Iam able to see only the folder. But if I restart the container the contents are visible. If I create any file in some other sub directory say mnt/subdir/test.txt then file is visible without restarting the container, only the mounted DVD content is not visible. Do you know why ?

how to handle this scenario. The volume contents will be dynamic and will changes every time.

thijsschnitger commented 6 years ago

Is it an issue with your storage driver perhaps? Can you verify by running a plain CentOS container (or any other) and trying to mount in there? Do any changes to the filesystem appear in the container?

ketank1000 commented 6 years ago

It’s because Docker maps the volume via the actual mounted filesystem. I was mounting a new filesystem under the mounted filesystem that’s mapped – it can’t handle that. For this you need to mount the ISO either inside the container or on the host before starting the container, and mapping it directly via /mnt/test:/mnt/test.