Friday 15 June 2012

nginx - Can't launch openresty docker -



nginx - Can't launch openresty docker -

trying launch openresty docker ( https://github.com/3scale/docker-openresty ) on personal mac , on docker digitalocean droplet, error:

debg 'openresty' stderr output: nginx: [emerg] bind() 0.0.0.0:8080 failed (98: address in use)

configs:

1) dockerfile

from 3scale/openresty add together openresty.conf /etc/supervisor/conf.d/ add together . /var/www cmd ["supervisord"]

2) openresty.conf

[program:openresty] command=/opt/openresty/nginx/sbin/nginx -p /var/www/ -c config/nginx.conf autorestart=true

3) config/nginx.conf

worker_processes 1; error_log logs/error.log; events { worker_connections 1024; } http { server { hear 8080; location / { default_type text/html; content_by_lua ' ngx.say("<p>hello, world</p>") '; } } }

how launch it:

docker build -t resty_docker . docker run resty_docker

result:

2014-11-02 11:27:01,232 crit supervisor running root (no user in config file) 2014-11-02 11:27:01,233 warn included file "/etc/supervisor/conf.d/openresty.conf" during parsing 2014-11-02 11:27:01,233 warn included file "/etc/supervisor/conf.d/cron.conf" during parsing 2014-11-02 11:27:01,233 warn included file "/etc/supervisor/conf.d/arping.conf" during parsing 2014-11-02 11:27:01,233 warn included 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 xml-rpc 2014-11-02 11:27:01,260 crit server 'unix_http_server' running without http authentication checking 2014-11-02 11:27:01,260 info supervisord started pid 1 2014-11-02 11:27:02,269 info spawned: 'cron' pid 7 2014-11-02 11:27:02,272 info spawned: 'arping' pid 8 2014-11-02 11:27:02,275 info spawned: 'redis' pid 9 2014-11-02 11:27:02,277 info spawned: 'openresty' pid 10 2014-11-02 11:27:02,302 debg fd 20 closed, stopped monitoring <poutputdispatcher @ 34498968 <subprocess @ 34067088 name openresty in state starting> (stdout)> 2014-11-02 11:27:02,302 debg fd 24 closed, stopped monitoring <poutputdispatcher @ 34499328 <subprocess @ 34067088 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 kid quit 2014-11-02 11:27:03,306 info success: cron entered running state, process has stayed > 1 seconds (startsecs) 2014-11-02 11:27:03,306 info success: arping entered running state, process has stayed > 1 seconds (startsecs) 2014-11-02 11:27:03,306 info success: redis entered running state, process has stayed > 1 seconds (startsecs) 2014-11-02 11:27:03,308 info spawned: 'openresty' pid 19 2014-11-02 11:27:03,318 debg 'openresty' stderr output: nginx: [emerg] bind() 0.0.0.0:8080 failed (98: address in use) 2014-11-02 11:27:03,820 debg 'openresty' stderr output: nginx: [emerg] bind() 0.0.0.0:8080 failed (98: address in use) 2014-11-02 11:27:04,329 debg 'openresty' stderr output: nginx: [emerg] bind() 0.0.0.0:8080 failed (98: address in use) 2014-11-02 11:27:04,329 info success: openresty entered running state, process has stayed > 1 seconds (startsecs) 2014-11-02 11:27:04,831 debg 'openresty' stderr output: nginx: [emerg] bind() 0.0.0.0:8080 failed (98: address in use)

ok, problem not onbuild cmd ["supervisord", "-n"], nginx going background , supervisor killing it.

after adding daemon off; nginx.conf problem gone.

nginx docker openresty

No comments:

Post a Comment