Vladimir Bunchuk
Vladimir Bunchuk

Reputation: 103

Docker: Can't pick up config file for nginx on Windows 10

I have some configuration in docker-compose.yml file.

nginx:
    image: nginx:latest
    ports:
        - 8083:80
    links:
        - php
    volumes:
        - /c/xampp/htdocs/Drukwerk/rePortal:/var/www/html
        - /c/docker/reportal/nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
php:
    build: ./php/
    expose:
        - 9000
    links:
        - mysql
    volumes:
        - /c/xampp/htdocs/Drukwerk/rePortal:/var/www/html
mysql:
    image: mysql:5.6
    volumes:
        - /var/lib/docker-data/reportal:/var/lib/mysql
    environment:
        MYSQL_ROOT_PASSWORD: password
        MYSQL_DATABASE: reportal
        MYSQL_USER: reportal
        MYSQL_PASSWORD: reportal

And when I try to run docker-compose up -d I got this error message:

C:\docker\reportal>docker run --name reportalnginx -v /c/xampp/htdocs/Drukwerk/rePortal:/var/www/html:ro -v /nginx/default.conf:/etc/nginx/conf.d/default.conf:ro -P -d nginx
docker: Error response from daemon: Conflict. The name "/reportalnginx" is already in use by container 2e7427b8dd13515c9868cceb31e56b7cd10626feff7a561c1bc19eeaa1158f1c. You have to remove (or rename) that container to be able to reuse that name..
See 'docker run --help'.

But when I remove line with config file path for nginx - it works normal.

Also I've been trying to use hint from this question: Question Link I was able to run nginx, but volumes wasn't connected.

How I can solve this kind of problem?

Upvotes: 1

Views: 837

Answers (1)

Salam Suleymanov
Salam Suleymanov

Reputation: 11

try to remove all containers docker rm -f $(docker ps -a -q) and run again. or check you nginx in system. maybe you can stop it.

Upvotes: 1

Related Questions