2017-05-02 12:44:21 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2018-02-02 10:51:33 +00:00
|
|
|
docker run -i -v `pwd`:/postfix_exporter ubuntu:16.04 /bin/sh << 'EOF'
|
2017-05-02 12:44:21 +00:00
|
|
|
set -ex
|
|
|
|
|
|
|
|
# Install prerequisites for the build process.
|
2018-02-02 10:51:33 +00:00
|
|
|
apt-get update -q
|
|
|
|
apt-get install -yq git golang-go libsystemd-dev
|
2017-05-02 12:44:21 +00:00
|
|
|
|
2018-02-02 10:51:33 +00:00
|
|
|
mkdir /go
|
|
|
|
export GOPATH=/go
|
2017-05-02 12:44:21 +00:00
|
|
|
cd /postfix_exporter
|
2018-02-02 10:51:33 +00:00
|
|
|
|
2017-05-02 12:44:21 +00:00
|
|
|
go get -d ./...
|
|
|
|
go build --ldflags '-extldflags "-static"'
|
|
|
|
strip postfix_exporter
|
|
|
|
EOF
|