Admin User 7 år sedan
förälder
incheckning
addc9434bb
4 ändrade filer med 41 tillägg och 2 borttagningar
  1. 2 0
      Dockerfile
  2. 16 2
      README.md
  3. 14 0
      build.sh
  4. 9 0
      modules.go

+ 2 - 0
Dockerfile

@@ -0,0 +1,2 @@
+FROM gliderlabs/logspout:master
+ENV SYSLOG_FORMAT rfc3164

+ 16 - 2
README.md

@@ -1,3 +1,17 @@
-# logspout-logstash
+# Custom Logspout Builds
 
-logspout с плагином logstash
+Forking logspout to change modules is unnecessary! Instead, you can create an
+empty Dockerfile based on `gliderlabs/logspout:master` and include a new
+`modules.go` file as well as the `build.sh` script that resides in the root of
+this repo 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.

+ 14 - 0
build.sh

@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+apk add --update go build-base git mercurial ca-certificates
+mkdir -p /go/src/github.com/gliderlabs
+cp -r /src /go/src/github.com/gliderlabs/logspout
+cd /go/src/github.com/gliderlabs/logspout
+export GOPATH=/go
+go get
+go build -ldflags "-X main.Version=$1" -o /bin/logspout
+apk del go git mercurial build-base
+rm -rf /go /var/cache/apk/* /root/.glide
+
+# backwards compatibility
+ln -fs /tmp/docker.sock /var/run/docker.sock

+ 9 - 0
modules.go

@@ -0,0 +1,9 @@
+package main
+
+import (
+	_ "github.com/gliderlabs/logspout/adapters/syslog"
+	_ "github.com/gliderlabs/logspout/transports/tcp"
+	_ "github.com/gliderlabs/logspout/transports/tls"
+	_ "github.com/gliderlabs/logspout/transports/udp"
+	_ "github.com/looplab/logspout-logstash"
+)