2016-09-23 16:20:57 +00:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
2016-10-24 22:18:58 +00:00
|
|
|
. $(dirname "$0")/binaries-commits
|
2016-09-23 16:20:57 +00:00
|
|
|
|
2016-10-27 23:52:56 +00:00
|
|
|
RM_GOPATH=0
|
|
|
|
|
|
|
|
TMP_GOPATH=${TMP_GOPATH:-""}
|
|
|
|
|
|
|
|
if [ -z "$TMP_GOPATH" ]; then
|
|
|
|
export GOPATH="$(mktemp -d)"
|
|
|
|
RM_GOPATH=1
|
|
|
|
else
|
|
|
|
export GOPATH="$TMP_GOPATH"
|
|
|
|
fi
|
2016-09-23 16:20:57 +00:00
|
|
|
|
2016-10-21 12:34:37 +00:00
|
|
|
# Do not build with ambient capabilities support
|
2016-10-19 18:49:10 +00:00
|
|
|
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}"
|
|
|
|
|
|
|
|
install_runc() {
|
|
|
|
echo "Install runc version $RUNC_COMMIT"
|
2016-10-21 12:34:37 +00:00
|
|
|
git clone https://github.com/docker/runc.git "$GOPATH/src/github.com/opencontainers/runc"
|
2016-10-19 18:49:10 +00:00
|
|
|
cd "$GOPATH/src/github.com/opencontainers/runc"
|
|
|
|
git checkout -q "$RUNC_COMMIT"
|
|
|
|
make BUILDTAGS="$RUNC_BUILDTAGS" $1
|
|
|
|
cp runc /usr/local/bin/docker-runc
|
|
|
|
}
|
|
|
|
|
|
|
|
install_containerd() {
|
|
|
|
echo "Install containerd version $CONTAINERD_COMMIT"
|
|
|
|
git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd"
|
|
|
|
cd "$GOPATH/src/github.com/docker/containerd"
|
|
|
|
git checkout -q "$CONTAINERD_COMMIT"
|
|
|
|
make $1
|
|
|
|
cp bin/containerd /usr/local/bin/docker-containerd
|
|
|
|
cp bin/containerd-shim /usr/local/bin/docker-containerd-shim
|
|
|
|
cp bin/ctr /usr/local/bin/docker-containerd-ctr
|
|
|
|
}
|
|
|
|
|
2016-10-27 23:52:56 +00:00
|
|
|
install_proxy() {
|
|
|
|
echo "Install docker-proxy version $LIBNETWORK_COMMIT"
|
|
|
|
git clone https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork"
|
|
|
|
cd "$GOPATH/src/github.com/docker/libnetwork"
|
|
|
|
git checkout -q "$LIBNETWORK_COMMIT"
|
|
|
|
go build -ldflags="$PROXY_LDFLAGS" -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy
|
|
|
|
}
|
|
|
|
|
2016-12-20 21:26:49 +00:00
|
|
|
install_bindata() {
|
|
|
|
echo "Install go-bindata version $BINDATA_COMMIT"
|
|
|
|
git clone https://github.com/jteeuwen/go-bindata "$GOPATH/src/github.com/jteeuwen/go-bindata"
|
|
|
|
cd $GOPATH/src/github.com/jteeuwen/go-bindata
|
|
|
|
git checkout -q "$BINDATA_COMMIT"
|
|
|
|
go build -o /usr/local/bin/go-bindata github.com/jteeuwen/go-bindata/go-bindata
|
|
|
|
}
|
|
|
|
|
2016-09-23 16:20:57 +00:00
|
|
|
for prog in "$@"
|
|
|
|
do
|
|
|
|
case $prog in
|
|
|
|
tomlv)
|
|
|
|
echo "Install tomlv version $TOMLV_COMMIT"
|
|
|
|
git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
|
|
|
|
cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
|
|
|
|
go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv
|
|
|
|
;;
|
|
|
|
|
|
|
|
runc)
|
2016-10-19 18:49:10 +00:00
|
|
|
install_runc static
|
|
|
|
;;
|
|
|
|
|
|
|
|
runc-dynamic)
|
|
|
|
install_runc
|
2016-09-23 16:20:57 +00:00
|
|
|
;;
|
|
|
|
|
|
|
|
containerd)
|
2016-10-19 18:49:10 +00:00
|
|
|
install_containerd static
|
|
|
|
;;
|
|
|
|
|
|
|
|
containerd-dynamic)
|
|
|
|
install_containerd
|
2016-09-23 16:20:57 +00:00
|
|
|
;;
|
|
|
|
|
2016-11-03 16:47:50 +00:00
|
|
|
tini)
|
|
|
|
echo "Install tini version $TINI_COMMIT"
|
|
|
|
git clone https://github.com/krallin/tini.git "$GOPATH/tini"
|
|
|
|
cd "$GOPATH/tini"
|
|
|
|
git checkout -q "$TINI_COMMIT"
|
2016-11-15 22:07:13 +00:00
|
|
|
cmake .
|
2016-11-03 16:47:50 +00:00
|
|
|
make tini-static
|
|
|
|
cp tini-static /usr/local/bin/docker-init
|
2016-09-23 16:20:57 +00:00
|
|
|
;;
|
|
|
|
|
2016-10-18 23:30:47 +00:00
|
|
|
proxy)
|
2016-10-27 23:52:56 +00:00
|
|
|
export CGO_ENABLED=0
|
|
|
|
install_proxy
|
|
|
|
;;
|
|
|
|
|
|
|
|
proxy-dynamic)
|
|
|
|
PROXY_LDFLAGS="-linkmode=external" install_proxy
|
2016-10-18 23:30:47 +00:00
|
|
|
;;
|
|
|
|
|
2016-10-31 18:22:28 +00:00
|
|
|
vndr)
|
|
|
|
echo "Install vndr version $VNDR_COMMIT"
|
|
|
|
git clone https://github.com/LK4D4/vndr.git "$GOPATH/src/github.com/LK4D4/vndr"
|
|
|
|
cd "$GOPATH/src/github.com/LK4D4/vndr"
|
|
|
|
git checkout -q "$VNDR_COMMIT"
|
|
|
|
go build -v -o /usr/local/bin/vndr .
|
|
|
|
;;
|
|
|
|
|
2016-12-20 21:26:49 +00:00
|
|
|
bindata)
|
|
|
|
install_bindata
|
|
|
|
;;
|
|
|
|
|
2016-09-23 16:20:57 +00:00
|
|
|
*)
|
2016-11-03 16:47:50 +00:00
|
|
|
echo echo "Usage: $0 [tomlv|runc|containerd|tini|proxy]"
|
2016-09-23 16:20:57 +00:00
|
|
|
exit 1
|
|
|
|
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-10-27 23:52:56 +00:00
|
|
|
if [ $RM_GOPATH -eq 1 ]; then
|
|
|
|
rm -rf "$GOPATH"
|
|
|
|
fi
|