github.com/endophage/docker@v1.4.2-0.20161027011718-242853499895/hack/dockerfile/install-binaries.sh (about)

     1  #!/bin/sh
     2  set -e
     3  set -x
     4  
     5  TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
     6  RUNC_COMMIT=02f8fa7863dd3f82909a73e2061897828460d52f
     7  CONTAINERD_COMMIT=52ef1ceb4b660c42cf4ea9013180a5663968d4c7
     8  GRIMES_COMMIT=74341e923bdf06cfb6b70cf54089c4d3ac87ec2d
     9  LIBNETWORK_COMMIT=0f534354b813003a754606689722fe253101bc4e
    10  
    11  export GOPATH="$(mktemp -d)"
    12  
    13  RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}"
    14  
    15  install_runc() {
    16  	echo "Install runc version $RUNC_COMMIT"
    17  	git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
    18  	cd "$GOPATH/src/github.com/opencontainers/runc"
    19  	git checkout -q "$RUNC_COMMIT"
    20  	make BUILDTAGS="$RUNC_BUILDTAGS" $1
    21  	cp runc /usr/local/bin/docker-runc
    22  }
    23  
    24  install_containerd() {
    25  	echo "Install containerd version $CONTAINERD_COMMIT"
    26  	git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd"
    27  	cd "$GOPATH/src/github.com/docker/containerd"
    28  	git checkout -q "$CONTAINERD_COMMIT"
    29  	make $1
    30  	cp bin/containerd /usr/local/bin/docker-containerd
    31  	cp bin/containerd-shim /usr/local/bin/docker-containerd-shim
    32  	cp bin/ctr /usr/local/bin/docker-containerd-ctr
    33  }
    34  
    35  for prog in "$@"
    36  do
    37  	case $prog in
    38  		tomlv)
    39  			echo "Install tomlv version $TOMLV_COMMIT"
    40  			git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
    41  			cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
    42  			go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv
    43  			;;
    44  
    45  		runc)
    46  			install_runc static
    47  			;;
    48  
    49  		runc-dynamic)
    50  			install_runc
    51  			;;
    52  
    53  		containerd)
    54  			install_containerd static
    55  			;;
    56  
    57  		containerd-dynamic)
    58  			install_containerd
    59  			;;
    60  
    61  		grimes)
    62  			echo "Install grimes version $GRIMES_COMMIT"
    63  			git clone https://github.com/crosbymichael/grimes.git "$GOPATH/grimes"
    64  			cd "$GOPATH/grimes"
    65  			git checkout -q "$GRIMES_COMMIT"
    66  			make
    67  			cp init /usr/local/bin/docker-init
    68  			;;
    69  
    70  		proxy)
    71  			echo "Install docker-proxy version $LIBNETWORK_COMMIT"
    72  			git clone https://github.com/docker/libnetwork.git "$GOPATH/src/github.com/docker/libnetwork"
    73  			cd "$GOPATH/src/github.com/docker/libnetwork"
    74  			git checkout -q "$LIBNETWORK_COMMIT"
    75  			CGO_ENABLED=0 go build -v -o /usr/local/bin/docker-proxy github.com/docker/libnetwork/cmd/proxy
    76  			;;
    77  
    78  		*)
    79  			echo echo "Usage: $0 [tomlv|runc|containerd|grimes|proxy]"
    80  			exit 1
    81  
    82  	esac
    83  done
    84  
    85  rm -rf "$GOPATH"