-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall_docker.sh
More file actions
96 lines (81 loc) · 2.86 KB
/
install_docker.sh
File metadata and controls
96 lines (81 loc) · 2.86 KB
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
90
91
92
93
94
95
96
#!/bin/bash
# -- Settings --
# Print welcome screen
echo "************************************************************"
echo "Martins Linux Setup and Environment Congfiguration tool"
echo "DOCKER Install Tool"
echo "------------------------------------------------------------"
echo "Author: Martin Bauernschmitt"
echo "************************************************************"
echo ""
echo "************************************************************"
echo "This script will install and config the following components:"
echo "------------------------------------------------------------"
echo "Docker: docker-ce, docker-compose"
echo "Docker-Images: Comming soon"
echo "************************************************************"
echo ""
echo "************************************************************"
# Check for SUDO
if [ "$EUID" -ne 0 ]
then echo "Please run program with sudo!"
echo "Exiting..."
echo "************************************************************"
exit
fi
echo "------------------------------------------------------------"
# Final question
while true; do
read -p "Do you wish to install this program?" yn
case $yn in
[Yy]* ) break;;
[Nn]* ) echo "Exiting..."; exit;;
* ) echo "Please answer yes or no.";;
esac
done
echo "************************************************************"
echo ""
echo ""
echo "************************************************************"
echo "Installing fancy stuff..."
echo ""
echo "------------------------------------------------------------"
echo "Update & Upgrade"
echo "------------------------------------------------------------"
apt update && apt upgrade -y
echo ""
echo ""
echo "------------------------------------------------------------"
echo "Docker Installation"
echo "------------------------------------------------------------"
echo "--> Installing necessary tools"
apt install -y apt-transport-https ca-certificates curl software-properties-common
echo "--> Adding GPG Key"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
echo "--> Adding repository"
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
echo "--> Updating"
apt update
echo "--> Installing docker"
apt install -y docker-ce docker-ce-cli containerd.io
echo "--> Adding user $SUDO_USER to docker group"
usermod -aG docker $SUDO_USER
echo ""
echo ""
echo "------------------------------------------------------------"
echo "Docker Images"
echo "------------------------------------------------------------"
echo "--> Coming soon"
echo ""
echo ""
echo "************************************************************"
echo ""
echo ""
echo "************************************************************"
echo "Finished -> Have fun dockering around "
echo "************************************************************"
echo ""
echo ""