Skip to content

Instantly share code, notes, and snippets.

@nicot
Created November 3, 2014 23:45
Show Gist options
  • Save nicot/6c680c626156f842444f to your computer and use it in GitHub Desktop.
Save nicot/6c680c626156f842444f to your computer and use it in GitHub Desktop.
haproxy dockerfile
FROM debian:sid
MAINTAINER Nico Tonozzi <dominic.tonozzi@gmail.com>
RUN apt-get update && apt-get install --no-install-recommends -y haproxy rsyslog
ADD haproxy.cfg /etc/haproxy/haproxy.cfg
EXPOSE 22 80 6667
CMD /etc/init.d/rsyslog start && /etc/init.d/haproxy start && tail -F /var/log/haproxy.log
@mbrooks
Copy link

mbrooks commented Dec 21, 2015

You might be able to do the following to be less hackerish:

RUN ln -s /dev/stdout /var/log/haproxy.log

CMD haproxy -f /etc/haproxy/haproxy.cfg -p "/var/run/haproxy.pid"

@ajay-aggarwal
Copy link

@mbrooks that wouldn't work. Since syslogd writes to /var/log/haproxy.log, above link will link /var/log/haproxy.log to syslogd's /dev/stdout. But we want output in haproxy's /dev/stdout.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment