Docker Community Forums

Share and learn in the Docker community.

Share not available for containers on docker start

docker

(Bertkl) #1

OS: Windows 10 Enterprise 1703
App version: 17.09.0-ce-win33 (13620)

I’m running a nginx-autoindex container in Docker that has a volume link to a folder on a drive, shared in Docker.
When I start docker, nginx-autoindex only shows an empty directory on every request.
This only gets fixed when I manually restart the static-nginx container after docker has started up.

I think the container gets started before Docker could share the drive, which results in nginx-autoindex thinking the volume is empty. nginx-autoindex reports no errors

Is there any way to delay the startup of the container until after the share is ready in Docker?
Or is this a bug that I need to report?

Run command for nginx:
docker run -p 8501:80 -v “E:\nginxlogs:/var/log/nginx” -v “E:\testlogs:/usr/share/nginx/html:ro” -d --restart always --name staticnginx jrelva/nginx-autoindex


(Lixikun) #2

Can you solve this problem ? I got the same problems.
I use the --restart=always option , the docker start the container automatically after the system reboot,but the -v option can’t mount and when I restart the container manually , the volume mounted correctly!
It’s so strange~
app version is 18.06. Thanks!