I want to let a docker container access data from a mounted USB external hard drive (ExFat). I mounted the hard drive to an existing and empty /tmp/driveTest
folder.
Next, I mounted the tmp
folder into the docker-container by entering - '/tmp:/mnt/fs'
in my docker-compose.yml file. When the Docker container starts, it successfully reads the data from the hard drive. But when I unmount the drive, without restarting the Docker container, the docker container still sees the folder/file structure while it should not.
When I start the Docker container and mount the drive then, it does not see the folder/file structure at all while it should.
I have tried the options with the privileged: true
flag, but that does not seem to have any effect. I also unsuccessfully tried a different mount option:
- type: bind
source: /tmp
target: /mnt/fs
If it is possible what I want to achieve, then how?