nginx docker官方镜像使用自定义启动命令启动失败
- 默认启动命令
nginx -g daemon off;
If you add a custom CMD in the Dockerfile, be sure to include -g daemon off; in the CMD in order for nginx to stay in the foreground, so that Docker can track the process properly (otherwise your container will stop immediately after starting)!
必须使用 -g deamon off;指令使nginx在前台运行,这样docker才能正确的跟踪执行过程,否则容器将在启动后立刻停止