forked from XinFinOrg/XinFin-Node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_docker.sh
executable file
·48 lines (31 loc) · 940 Bytes
/
install_docker.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
#!/bin/bash
function installDocker(){
echo "Installing Docker"
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce -y
curl -o /usr/local/bin/docker-compose -L \
"https://github.com/docker/compose/releases/download/1.21.2/docker-compose-$(uname -s)-$(uname -m)"
chmod +x /usr/local/bin/docker-compose
sleep 5
echo "Docker Installed successfully"
}
function init(){
if [ -z "$(which docker)" ]; then
installDocker
fi
}
function main(){
init
}
main