Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with default command? #1

Closed
caussourd opened this issue Mar 12, 2015 · 4 comments
Closed

Issue with default command? #1

caussourd opened this issue Mar 12, 2015 · 4 comments

Comments

@caussourd
Copy link

I'm running Docker 1.5 and haproxy:1.5

As a user pointed out on the Docker hub page, I had to override the command with haproxy -db -f /usr/local/etc/haproxy/haproxy.cfg to run the container.

With the default command (CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]), the container exits with no logs.

Apparently, the -db option allows haproxy to run in foreground: http://cbonte.github.io/haproxy-dconv/configuration-1.5.html#3.1

@tianon
Copy link
Member

tianon commented Mar 12, 2015

I'm +1 on fixing this, but I'm not sure -db is recommended for generic use:

-db
Disables background mode (stays in foreground, useful for debugging). For debugging, the '-db' option is very useful as it temporarily disables daemon mode and multi-process mode. The service can then be stopped by simply pressing Ctrl-C, without having to edit the config nor run full debug.

Isn't running haproxy single-threaded a bit of a problem?

@calh
Copy link

calh commented Mar 18, 2015

Check your haproxy.cfg for daemon listed in the global mode. I was stumped on this as well until that jumped out at me in my config file. (I had just copied a config from another test haproxy instance I use on my workstation)

When I removed daemon, the docker image ran correctly in the foreground with the default image command.

@caussourd
Copy link
Author

That's it. Well spotted. Thanks @calh

@dbu
Copy link

dbu commented May 29, 2015

hah! tried to improve the documentation: docker-library/docs#248

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants