• 1 Post
  • 8 Comments
Joined 1 year ago
cake
Cake day: July 2nd, 2023

help-circle


  • Thanks for your answer. I tried mounting it to a folder inside the one I’m using in the compose file but strangely it didn’t work. So I thought that the only way that wouldn’t need to delay docker start is to restart the container just after the drive has been mounted.

    And that’s what I ended up doing as the drive mount is a systemd service and therefore I can use ExecStartPost to restart the container. That way this doesn’t affect other containers and also lets this one start even if the drive has not been mounted which I want in case there’s no internet connection


  • Thanks for your suggestion. That’s what I first thought but there are some issues.

    I have other containers that do not require this drive to be mounted. Main problem is that if for some reason the drive cannot be mounted (e.g. no internet connection), then docker would not start any of those containers.

    That’s why I need a particular solution. While writing this it has come my mind that I’ve got a container which mounts / as a read-only volume in its /mnt and it seems to work fine there. Maybe if I set the volume to mount /media/user instead of the drive it would work?