Skip to content

Commit

Permalink
allowing easy custom builds of logspout
Browse files Browse the repository at this point in the history
  • Loading branch information
progrium committed Mar 27, 2015
1 parent b9e5a1f commit b51760f
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ VOLUME /mnt/routes
EXPOSE 8000

COPY . /go/src/github.com/gliderlabs/logspout
ONBUILD COPY ./modules.go /go/src/github.com/gliderlabs/logspout/modules.go
RUN apk-install go git mercurial \
&& cd /go/src/github.com/gliderlabs/logspout \
&& export GOPATH=/go \
Expand Down
2 changes: 2 additions & 0 deletions custom/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
FROM gliderlabs/logspout:master
ENV SYSLOG_FORMAT rfc3164
16 changes: 16 additions & 0 deletions custom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Custom Logspout Builds

Forking logspout to change modules is unnecessary! Instead, you can create an
empty Dockerfile based on logspout and include a new `modules.go` file for the
build context that will override the standard one.

This directory is an example of doing this. It pairs logspout down to just the
syslog adapter and TCP transport. Note this means you can only create routes
with `syslog+tcp` as the adapter.

It also shows you can take this opportunity to change default configuration by
setting environment in the Dockefile. Here we change the syslog adapter format
from the default of `rfc5424` to old school `rfc3164`.

Now you just have to `docker build` with this Dockerfile and you'll get a custom
logspout container image. No need to install Go, no need to maintain a fork.
6 changes: 6 additions & 0 deletions custom/modules.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package main

import (
_ "github.com/gliderlabs/logspout/adapters/syslog"
_ "github.com/gliderlabs/logspout/transports/tcp"
)

0 comments on commit b51760f

Please sign in to comment.