個人用 Mac および Docker digitalocean ドロップレットで openresty docker ( https://github.com/3scale/docker-openresty ) を起動しようとすると、エラーが発生します。
DEBG 'openresty' stderr output:
nginx: [emerg] bind() to 0.0.0.0:8080 failed (98: Address already in use)
構成:
1) Dockerfile
FROM 3scale/openresty
ADD openresty.conf /etc/supervisor/conf.d/
ADD . /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 {
listen 8080;
location / {
default_type text/html;
content_by_lua '
ngx.say("<p>hello, world</p>")
';
}
}
}
起動方法:
docker build -t resty_docker .
docker run resty_docker
結果:
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)