docker-compose启动nginx卡在Attaching to nginx
docker-compose.yml文件version: '3'services:nginx:image: "nginx:latest"container_name: nginxvolumes:- ./conf.d:/etc/nginx/conf.d- ./access.log...
·
docker-compose.yml文件
version: '3'
services:
nginx:
image: "nginx:latest"
container_name: nginx
volumes:
- ./conf.d:/etc/nginx/conf.d
- ./access.log:/var/log/nginx/access.log
- ./html:/usr/share/nginx/html
ports:
- "8080:80"
启动后一直卡在Attaching to nginx
原因
volumes:
- ./conf.d:/etc/nginx/conf.d
用本地conf.d目录覆盖了容器内部/etc/nginx/conf.d,本地conf.d里面没有文件,所以把默认的defautl.conf覆盖没了。解决办法就是在conf.d目录下添加default.conf文件.
更多推荐
已为社区贡献5条内容
所有评论(0)