Docker nginx映像无法启动(正确) 总是重新启动。
第一步,当使用docker-composer运行nginx官方映像时,一切正常。
ports:
- "8000:80"
- "3000:443"
restart: always
volumes:
- "./etc/nginx/default.conf:/etc/nginx/conf.d/default.conf"
- "./etc/ssl:/etc/ssl"
- ".:/web"
但是,我正在尝试使用嵌入式代码生成一个docker映像:
FROM nginx
WORKDIR /web
## Code
COPY --chown=0:0 source/store.services.api/etc/nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --chown=0:0 source/store.services.api/etc/ssl /etc/ssl
COPY --chown=0:33 source/store.services.api /web
我运行它:
run -it --name nginx_code -d nginx_code
当然,投币者会停止:
docker日志显示:
nginx: [alert] could not open error log file: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
2019/05/14 12:50:02 [emerg] 1#1: open() "/var/log/nginx/error.log" failed (2: No such file or directory)
我需要在哪里解决这个问题?
非常感谢