I am having problems with docker volumes which reside on my NAS and which are not always available because the NAS is offline. The volumes use the local driver and are ‘type=cifs’
When I try to start a container which refers to offline volumes, I get the following (totally expected!) error:
ERROR: for plex Cannot start service plex: OCI runtime create failed: container_linux.go:370: starting container process caused: process_linux.go:459: container init caused: rootfs_linux.go:59: mounting “/var/lib/docker/volumes/plex_movies/_data” to rootfs at “/movies” caused: stat /var/lib/docker/volumes/plex_movies/_data: host is down: unknown
ERROR: Encountered errors while bringing up the project.
However, once the container is running, then it is not a problem to take the volumes offline for a time and then bring them back online again later - the container handles the missing files correctly.
Is it possible to start a container even if one or more of the volumes referenced in the docker-compose file are not available online at that moment?
If it is possible to take the volumes offline when the container is running, then it must surely be possible to start the container when the volumes are offline?
I am using the linuxserver/plex image here but I think the question is more general and applies to any container which refers to a docker volume which is not always available.
Thanks for any guidance.