Docker:无法启动服务nginx

我正在使用docker -compose处理nginx服务,我创build了docker-compose.yml文件:

version: '2' services: nginx: image: nginx:1.11.8-alpine ports: - "8858:80" volumes: - ./site.conf:/etc/nginx/conf.d/default.conf - ./code:/usr/share/nginx/html - ./html:/myapp - ./site.conf:/etc/nginx/conf.d/site.conf - ./error.log:/var/log/nginx/error.log - ./nginx.conf:/etc/nginx/nginx.conf:ro 

这是site.conf文件

  server { listen 80; index index.html index.php; server_name localhost; error_log /var/log/nginx/error.log; location / { root /usr/share/nginx/html; } location /html { alias /myapp; } } 

这是docker组成的结果

错误:对于ef5152b88a7c_ef5152b88a7c_nginxdocker_nginx_1无法启动服务nginx:oci运行时错误:container_linux.go:247:启动容器进程导致“process_linux.go:359:容器init导致”rootfs_linux.go:54:挂载\\“/ root / nginx-搬运工/ nginx.conf \\ “到根文件\\ ”的/ var / lib中/搬运工/ AUFS的/ mnt / b463f0e0ca95db8cd570dfb68fcf206df31e86998e725465a7673ca192af8342 \\“ 在\\” 的/ var / lib中/搬运工/ AUFS的/ mnt / b463f0e0ca95db8cd570dfb68fcf206df31e86998e725465a7673ca192af8342的/ etc / nginx的/ nginx的.conf \\“导致\\”不是目录\\“\”“

:你是否试图将一个目录挂载到一个文件上(反之亦然)? 检查指定的主机path是否存在,并且是预期的types