首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >不能启动开敞式码头

不能启动开敞式码头
EN

Stack Overflow用户
提问于 2014-11-02 14:07:48
回答 2查看 2.9K关注 0票数 1

试图在个人Mac和docker数字海洋液滴上启动openresty ( https://github.com/3scale/docker-openresty ),但得到了一个错误:

代码语言:javascript
运行
复制
DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)

Con图:

1) Dockerfile

代码语言:javascript
运行
复制
FROM 3scale/openresty
ADD openresty.conf /etc/supervisor/conf.d/
ADD . /var/www
CMD ["supervisord"]

2) Openresty.conf

代码语言:javascript
运行
复制
[program:openresty]
command=/opt/openresty/nginx/sbin/nginx -p /var/www/ -c config/nginx.conf
autorestart=true

3) config/nginx.conf

代码语言:javascript
运行
复制
worker_processes  1;
error_log logs/error.log;
events {
    worker_connections 1024;
}
http {
server {
    listen 8080;
    location / {
        default_type text/html;
        content_by_lua '
            ngx.say("<p>hello, world</p>")
        ';
    }
}
}

我如何启动它:

代码语言:javascript
运行
复制
docker build -t resty_docker .
docker run resty_docker

结果

代码语言:javascript
运行
复制
2014-11-02 11:27:01,232 CRIT Supervisor running as root (no user in config file)
2014-11-02 11:27:01,233 WARN Included extra file "/etc/supervisor/conf.d/openresty.conf" during parsing
2014-11-02 11:27:01,233 WARN Included extra file "/etc/supervisor/conf.d/cron.conf" during parsing
2014-11-02 11:27:01,233 WARN Included extra file "/etc/supervisor/conf.d/arping.conf" during parsing
2014-11-02 11:27:01,233 WARN Included extra file "/etc/supervisor/conf.d/redis.conf" during parsing
2014-11-02 11:27:01,260 INFO RPC interface 'supervisor' initialized
2014-11-02 11:27:01,260 WARN cElementTree not installed, using slower XML parser for XML-RPC
2014-11-02 11:27:01,260 CRIT Server 'unix_http_server' running without any HTTP authentication checking
2014-11-02 11:27:01,260 INFO supervisord started with pid 1
2014-11-02 11:27:02,269 INFO spawned: 'cron' with pid 7
2014-11-02 11:27:02,272 INFO spawned: 'arping' with pid 8
2014-11-02 11:27:02,275 INFO spawned: 'redis' with pid 9
2014-11-02 11:27:02,277 INFO spawned: 'openresty' with pid 10
2014-11-02 11:27:02,302 DEBG fd 20 closed, stopped monitoring <POutputDispatcher at 34498968 for     <Subprocess at 34067088 with name openresty in state STARTING> (stdout)>
2014-11-02 11:27:02,302 DEBG fd 24 closed, stopped monitoring <POutputDispatcher at 34499328 for <Subprocess at 34067088 with name openresty in state STARTING> (stderr)>
2014-11-02 11:27:02,302 INFO exited: openresty (exit status 0; not expected)
2014-11-02 11:27:02,303 DEBG received SIGCLD indicating a child quit
2014-11-02 11:27:03,306 INFO success: cron entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-11-02 11:27:03,306 INFO success: arping entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-11-02 11:27:03,306 INFO success: redis entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-11-02 11:27:03,308 INFO spawned: 'openresty' with pid 19
2014-11-02 11:27:03,318 DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)

2014-11-02 11:27:03,820 DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)

2014-11-02 11:27:04,329 DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)

2014-11-02 11:27:04,329 INFO success: openresty entered RUNNING state, process has stayed up for > than 1 seconds (startsecs)
2014-11-02 11:27:04,831 DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-11-04 16:03:15

好的,问题不是ONBUILD CMD ["supervisord", "-n"],而是nginx去后台和主管杀死它。

在将daemon off;添加到nginx.conf之后,问题就消失了。

票数 3
EN

Stack Overflow用户

发布于 2014-11-02 23:20:21

父容器3 3scale/openresty有行ONBUILD CMD ["supervisord", "-n"] --这意味着sypervisord已经在运行(关于ONBUILD的尾盘,请参阅这里 )。当您的监督命令运行时,它会发现冲突。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26700198

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档