Add wrapper to clean install go binaries

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-08-04 18:52:13 +02:00
parent bcdbc4326a
commit 431d1be850
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

18
bin/spawn_gotool Executable file
View file

@ -0,0 +1,18 @@
#!/bin/bash
set -euo pipefail
PKG=${1:-}
[[ -n ${PKG} ]] || {
echo "Usage: $0 <package>" >&2
exit 1
}
cat -s <<EOF | docker run --rm -i -e CGO_ENABLED=0 -v "$(pwd):$(pwd)" golang:alpine sh -ex -
apk --no-cache add git
go get -v ${PKG}
chown $(id -u):$(id -g) /go/bin/*
mv /go/bin/* $(pwd)
EOF