This line in docker-compose.yml file:
volumes:
- /rancher-nfs/nginx/nginx.conf:/etc/nginx/conf.d/default.conf
cause this issue:
Activating (Expected state running but got error: Error response from daemon: oci runtime error: container_linux.go:247: starting container process caused “process_linux.go:359: container init caused “rootfs_linux.go:54: mounting \”/rancher-nfs/nginx/nginx.conf\” to rootfs \"/var/lib/docker/overlay/e4cadcb773b96bbf5b0162a247ad4816de5197985693b556cb2db467daad897c/merged\" at \"/var/lib/docker/overlay/e4cadcb773b96bbf5b0162a247ad4816de5197985693b556cb2db467daad897c/merged/etc/nginx/conf.d/default.conf\" caused \“not a directory\”"" : Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type)
Is “/rancher-nfs/nginx/nginx.conf” a local directory on the host?
By the name, it sounds like you are trying to use rancher-nfs as the source? If so, then you need to have a separate volumes: declaration.
Are you, in fact, trying to use rancher-nfs as the source for the volume?
When you specify a volume, you specify a source and a target within the container, separated by a colon. In your config, you are using “/rancher-nfs/nginx/nginx.conf” as the source, so docker is going to look on the host’s local filesystem in that directory. If that directory doesn’t exist on the host, then you would get an error.
If you want to use rancher-nfs, then you need to have the named volume and tell Rancher that the volume needs to use the rancher-nfs driver to access the source.