I have an Ubuntu 18 image and I can correctly start with docker run and the container runs fine, except that the content of the /etc/fstab file is not mounted when the container is up and running.
where 99.99… is of course a to be replaced with the correct IP address. Credentials and file access rights are OK, after boot using mount -a as root mounts the fstab entries correctly !
Why it is not mounted at boot time ? How I can mount it ?
You are aware that a container is not a vm, aren’t you?
Only commands defined in the entrypoint script are executed.
If you desperatly want this to happen, you have to enhance your entrypoint script to perform the tasks requried!
Though, your approach is not the typical docker solution for this task. Either Mount the share and map it into the container OR create a volume that does it for your. If you want the volume approach you might want to write a compose file for it and use cifs with the local driver.
Hi !
Sure, yes I’m aware of that I’ve also tried with the entrypoint approach but it was not working… will keep debugging. Anyway, thanks for the suggestion, I’ll follow that !
The map is a webdav mount. It cannot be mapped locally because there is NO LOCAL FILESYSTEM - the container is build from image.
Using ENTRYPOINT will mount the webdav but exit immediately afterwards. Using a script with sleep infinity at the end will keep the container running, and the webdav will be mounted, but the container will not respond to network requests - it’s useless.