-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstadocker.sh
83 lines (69 loc) · 2.89 KB
/
instadocker.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
#!/usr/bin/env bash
# Excelsior INSTA-DOCKER Script January 2024
export TERM=xterm-256color
echo "$(tput setaf 45) ____ _ _ ____ ____ _ ____ _ ____ ____ "
echo "$(tput setaf 45) |___ \/ | |___ | [__ | | | |__/ "
echo "$(tput setaf 45) |___ _/\_ |___ |___ |___ ___] | |__| | \ "
echo "$(tput setaf 7)"
echo "$(tput setaf 7) **************************************************************************************"
echo "$(tput setaf 7) * NEAR INSTANT DOCKER SUITE *"
echo "$(tput setaf 7) **************************************************************************************"
echo "$(tput setaf 7) Debian INSTA-DOCKER Script March 2024 "
echo ""
# Add Docker's official GPG key:
echo "Hey $USER, let's get started. Update, install prereqs, and keyrings"
sudo apt-get update
function loading_icon() {
local load_interval="${1}"
local loading_message="${2}"
local elapsed=0
local loading_animation=( ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷ )
echo -n "${loading_message} "
# This part is to make the cursor not blink
# on top of the animation while it lasts
tput civis
trap "tput cnorm" EXIT
while [ "${load_interval}" -ne "${elapsed}" ]; do
for frame in "${loading_animation[@]}" ; do
printf "%s\b" "${frame}"
sleep 0.2
done
elapsed=$(( elapsed + 1 ))
done
printf " \b\n"
}
loading_icon 60 "Updating"
sudo apt-get install ca-certificates curl -y
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo "Add the repository to Apt sources:"
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get update
function loading_icon() {
local load_interval="${1}"
local loading_message="${2}"
local elapsed=0
local loading_animation=( ⣾ ⣽ ⣻ ⢿ ⡿ ⣟ ⣯ ⣷ )
echo -n "${loading_message} "
# This part is to make the cursor not blink
# on top of the animation while it lasts
tput civis
trap "tput cnorm" EXIT
while [ "${load_interval}" -ne "${elapsed}" ]; do
for frame in "${loading_animation[@]}" ; do
printf "%s\b" "${frame}"
sleep 0.2
done
elapsed=$(( elapsed + 1 ))
done
printf " \b\n"
}
loading_icon 60 "And finally, install docker-ce and compose"
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin docker-compose -y
sudo usermod -aG docker $USER
exec su -l $USER