Docker-compose host path error with nginx

Hi community,

I would like start MySQL, PHP and nginx in container docker. MySQL and PHP run with success. But nginx return an error :

ERROR: for nginx Cannot start service nginx: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\\"./app/config/docker/nginx.conf\\\" to rootfs \\\"/mnt/sda1/var/lib/docker/aufs/mnt/940c53b3fa5c7cab0032c538b8f26a52c713697f6b0f2bb6c92483530b1cbfe7\\\" at \\\"/mnt/sda1/var/lib/docker/aufs/mnt/940c53b3fa5c7cab0032c538b8f26a52c713697f6b0f2bb6c92483530b1cbfe7/etc/nginx/nginx.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
e[31mERRORe[0m: Encountered errors while bringing up the project.

My docker-compose for nginx :

nginx:
    image: nginx:1.10-alpine
    ports:
        - 80:80
    networks:
        - default
    depends_on:
        - php
    volumes_from:
        - application
    volumes:
        - ./app/config/docker/nginx.conf:/etc/nginx/nginx.conf
        - ./app/config/docker/symfony.conf:/etc/nginx/sites-available/symfony.conf
        - ./app/config/docker/symfony.conf:/etc/nginx/sites-enabled/symfony.conf
        - ./app/config/docker/upstream.conf:/etc/nginx/conf.d/upstream.conf 

I’ve check, and ./app/config/docker/nginx.conf is good :confused:

I use :
Docker version 1.12.6, build 78d1802
docker-compose version 1.9.0, build 2585387
Windows 10 family

Do you have any idea ?

Thank you !

Nobody has an idea ? :slight_smile:

I’m having the same problem. Did find get a solution?

Hi @chielsen

Yes, i’ve resolve my problem. You need to mount your folder in your docker container.

It resolve my problem :slight_smile:

But i don’t get why this sometimes does work and sometimes not. Also in the documentation it says it should be possible to mount a file?

What is your exact file now?

Please help. How to mount the folder in docker?

I switched to Linux containers and that solved problem. But another one appear =(

I still have the problem. I actually even bought a new pc and installed windows 10 from scratch, but still have the same issue. I just have to cry :frowning:

I have just gotten this error, any docker pro please help me.

unknown: 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