Add a script for building a statically linked version of the exporter.
This commit is contained in:
1 parent
01168ec98f
commit
14ec675549
1 file changed
+17
Executable
+17
@@ -0,0 +1,17 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
docker run -i -v `pwd`:/openvpn_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 openvpn_exporter.
|
||||||
|
cd /openvpn_exporter
|
||||||
|
export GOPATH=/gopath
|
||||||
|
go get -d ./...
|
||||||
|
go build --ldflags '-extldflags "-static"'
|
||||||
|
strip openvpn_exporter
|
||||||
|
EOF
|
||||||
Reference in new issue
Block a user