build_static.sh updated to ubuntu docker container to support systemd journal usage.

This commit is contained in:
Bart Vercoulen 2018-02-02 11:51:33 +01:00
parent 0a26a0348b
commit d0b229822e
2 changed files with 9 additions and 6 deletions

View File

@ -16,5 +16,8 @@ entries to a second file:
mail.* -/var/log/postfix_exporter_input.log
```
There is also an option to collect the metrics via the systemd journal instead of a log file.
Please refer to this utility's `main()` function for a list of supported
command line flags.

View File

@ -1,16 +1,16 @@
#!/bin/sh
docker run -i -v `pwd`:/postfix_exporter alpine:edge /bin/sh << 'EOF'
docker run -i -v `pwd`:/postfix_exporter ubuntu:16.04 /bin/sh << 'EOF'
set -ex
# Install prerequisites for the build process.
apk update
apk add ca-certificates git go libc-dev
update-ca-certificates
apt-get update -q
apt-get install -yq git golang-go libsystemd-dev
# Build the postfix_exporter.
mkdir /go
export GOPATH=/go
cd /postfix_exporter
export GOPATH=/gopath
go get -d ./...
go build --ldflags '-extldflags "-static"'
strip postfix_exporter