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

allowing easy custom builds of logspout #66

Merged
merged 1 commit into from
Mar 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
)