我是docker和haproxy的新手..我尝试遵循官方docker hub repo中的示例.
所以,我有Dockerfile
- @H_502_8@FROM haproxy:1.5
- COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg
和简单的haproxy配置(我希望将本地调用重定向到我的EB实例)
- @H_502_8@global
- # daemon
- maxconn 256
- defaults
- mode http
- timeout connect 5000ms
- timeout client 50000ms
- timeout server 50000ms
- frontend http-in
- bind *:80
- default_backend servers
- backend servers
- server server1 {my-app}.elasticbeanstalk.com:80 maxconn 32
构建并运行
- @H_502_8@$docker build .
- $docker run --rm d4598bcc293f
容器启动并卡住,Ctrl C不会停止容器. “ docker kill”仅帮助.
我的EB资源已启动并正在运行
- @H_502_8@$curl {my-app}.elasticbeanstalk.com/status
- {
- "status": "OK"
- }
但是本地通话失败
我想念什么或做错什么?
谢谢!
UPDATE: I’ve found the problem with calls redirections. Wrong port
number in haproxy.cfg.But this problem still annoys me… Container starts and stucks,
Ctrl+C doen’t stop it. “docker kill” helps only.
最佳答案