From 2e75bb45839def49bad1867996d11fab1b91eba6 Mon Sep 17 00:00:00 2001 From: Ed Schouten Date: Tue, 2 May 2017 14:44:21 +0200 Subject: [PATCH] Add a build script for the Postfix exporter. --- build_static.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 build_static.sh diff --git a/build_static.sh b/build_static.sh new file mode 100755 index 0000000..3c4851d --- /dev/null +++ b/build_static.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +docker run -i -v `pwd`:/postfix_exporter alpine:edge /bin/sh << 'EOF' +set -ex + +# Install prerequisites for the build process. +apk update +apk add ca-certificates git go libc-dev +update-ca-certificates + +# Build the postfix_exporter. +cd /postfix_exporter +export GOPATH=/gopath +go get -d ./... +go build --ldflags '-extldflags "-static"' +strip postfix_exporter +EOF