What may become a place for random musings about law as well as code by @DominikTo.
NGINX with syslog support in Docker
13 Feb 2014
If you haven’t heard about Docker, this post will be of little interest, but if you also have started dockering-all-the-things you might have run into the limited log handling capabilities for Docker containers (Docker v0.8.0 is the current version at the time of writing), too. I especially noticed this when trying to run NGINX inside a container.
Being able to attach /dev/log of the host system to /dev/log inside a container (by adding a -v /dev/log:/dev/log parameter to docker run) made it seem like a quick fix - but only until you notice this hint in the NGINX docs:
Luckily there is an open source syslog patch for NGINX on GitHub. Below is a quick and dirty Dockerfile for an Ubuntu 13.10 container with a patched NGINX version.
There are a few things missing (e.g. NGINX php-fpm config, adding your application, actually configuring NGINX to use syslog), but you’ll probably figure that out.
Any comments? Ping me on Twitter. 👉🏻 Get my newsletter for occasional updates. ✌🏻