-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall-docker.sh
executable file
·49 lines (34 loc) · 957 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
48
49
#!../../../usr/bin/bash
echo Installing Docker
read -p "Production install? (y/N): " production
echo Removing Legacy Version
sudo apt-get remove docker docker-engine
echo Installing Prerequisites
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
echo Downloadking Repository Key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo Setting Up Repository
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
echo Updating Package Index
sudo apt-get update
echo Installing Docker Community Edition
if [[ "$production" == "y" ]]
then
apt-cache madison docker-ce
read -p "Version (latest): " version
if [[ "$version" -ne "" ]]
then
sudo apt-get install docker-ce=$version
else
sudo apt-get install docker-ce
fi
fi
echo Running Test Container
sudo docker run hello-world