Add wrapper to clean install go binaries
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
bcdbc4326a
commit
431d1be850
1 changed files with 18 additions and 0 deletions
18
bin/spawn_gotool
Executable file
18
bin/spawn_gotool
Executable 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
|
Loading…
Reference in a new issue