-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-docker.sh
More file actions
executable file
·53 lines (45 loc) · 1.61 KB
/
install-docker.sh
File metadata and controls
executable file
·53 lines (45 loc) · 1.61 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
#!/bin/bash
echo "This script installs Docker from it's own repositories"
read -p "Do you want to continue? [Y/n] " yn
case $yn in
[yY] ) ;;
* ) echo Abort.; exit;;
esac
echo "apt update is done...";
apt update
echo "apt update done!";
read -p "Do you want to do a dist-upgrade first? [Y/n] " yn
case $yn in
[yY] )
echo "dist-upgrade is done...";
apt dist-upgrade -y;
echo "dist-upgrade done!";;
esac
read -p "Do you want to install curl, htop, pwgen, zip, unzip, whois, net-tools and dnsutils? [Y/n] " yn
case $yn in
[yY] )
echo "packages are installed...";
for package in curl htop pwgen zip unzip whois net-tools dnsutils; do
if ! dpkg -l "$package" | grep -q ^ii; then
apt install -y "$package"
fi
done;
echo "installation done!";;
esac
echo "gnupg, ca-certificates and apt-transport-https are installed..."
for package in gnupg ca-certificates apt-transport-https; do
if ! dpkg -l "$package" | grep -q ^ii; then
apt install -y "$package"
fi
done
echo "installation done!"
echo "Docker repo key is downloaded and added..."
wget -qO - https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/docker.gpg
echo "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
echo "download and adding done!";
echo "apt update is done (again)...";
apt update
echo "apt update done!";
echo "Docker is installed...";
apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
echo "installation done!";