-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-docker-tools.sh
executable file
·92 lines (84 loc) · 2.5 KB
/
install-docker-tools.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash -ex
function finish {
CONTAINERS=$(docker ps -a | grep -v "^CONTAINER" | awk ' { print $1 } ' )
for CONTAINER in ${CONTAINERS}; do
docker rm ${CONTAINER}
done
IMAGES=$(docker images | grep -v "^REPOSITORY" | awk ' { print $3 } ' )
for IMAGE in ${IMAGES}; do
docker rmi ${IMAGE}
done
service docker stop
sleep 5
DM_DEVS=$(dmsetup ls | grep -v "^No" | awk ' { print $1 } ')
for DM_DEV in ${DM_DEVS}; do
dmsetup remove /dev/mapper/${DM_DEV}
done
while [[ -f /tmp/wait ]]; do
sleep 10
done
rm -rf /var/lib/docker/devicemapper
rm -rf /usr/src/*
rm -rf /opt/go/src
}
trap finish EXIT
apt-get update
apt-get install -y -q git mercurial make python-setuptools libyaml-dev python-dev
service docker start
sleep 30
pushd /usr/src
git clone https://github.com/docker/compose
pushd compose
python setup.py install
popd
popd
export PLATFORM="linux/amd64"
export GOOS=${PLATFORM%/*}
export GOARCH=${PLATFORM##*/}
export GOPATH=/opt/go
export GOSRC=/usr/src/go
export PATH=${PATH}:${GOSRC}/bin:${GOPATH}/bin
go get github.com/tools/godep
go get golang.org/x/tools/cmd/vet
mkdir -p ${GOPATH}/src/github.com/docker
pushd ${GOPATH}/src/github.com/docker
git clone https://github.com/docker/machine
git clone https://github.com/docker/swarm
#git clone https://github.com/docker/libnetwork
#git clone https://github.com/docker/distribution
pushd machine
make
cp docker-machine_linux-amd64 /usr/bin/docker-machine
popd
pushd swarm
godep go install .
cp ${GOPATH}/bin/swarm /usr/bin/docker-swarm
popd
#pushd libnetwork
#make
#popd
#godep get github.com/Sirupsen/logrus
#godep get github.com/docker/docker/pkg/tarsum
#godep get github.com/docker/libtrust
#godep get github.com/gorilla/mux
#godep get golang.org/x/net/context
#godep get github.com/codegangsta/cli
#godep get github.com/AdRoll/goamz/aws
#godep get github.com/AdRoll/goamz/cloudfront
#godep get github.com/AdRoll/goamz/s3
#godep get github.com/Azure/azure-sdk-for-go/storage
#godep get github.com/Sirupsen/logrus/formatters/logstash
#godep get github.com/bugsnag/bugsnag-go
#godep get github.com/garyburd/redigo/redis
#godep get github.com/gorilla/handlers
#godep get github.com/stevvooe/resumable
#godep get github.com/stevvooe/resumable/sha256
#godep get github.com/stevvooe/resumable/sha512
#godep get github.com/yvasiyarov/gorelic
#godep get golang.org/x/crypto/bcrypt
#godep get gopkg.in/yaml.v2
#godep get gopkg.in/check.v1
#pushd distribution
#make
#cp bin/registry /usr/bin/docker-registry
#popd