samedi 18 avril 2015

haproxy in docker container

I'm new to docker and haproxy.. I tried to follow the example from the official docker hub repo.


So, I have Dockerfile



FROM haproxy:1.5
COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg


and simple haproxy config (which I expect to redirect local calls to my EB instance)



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


Build and run



$ docker build .
$ docker run --rm d4598bcc293f


Container starts and stucks, Ctrl+C doen't stop it. "docker kill" helps only.


My EB resource is up and running



$ curl {my-app}http://.elasticbeanstalk.com/status
{
"status": "OK"
}


But local calls fail



$ boot2docker ip
192.168.59.104

$ curl 192.168.59.104/status
curl: (7) Failed to connect to 192.168.59.104 port 80: Connection refused


What am I missing or doing wrong?


Thank you!



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.






Aucun commentaire:

Enregistrer un commentaire