-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_docker-ce.sh
executable file
·40 lines (33 loc) · 1.22 KB
/
install_docker-ce.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
#!/bin/bash
GREEN='\033[0;32m';
LGREEN='\033[1;32m';
RED='\033[0;31m';
NC='\033[0m'; #No Color
if [ -z "$1" ] || [ "$EUID" -ne 0 ];then
printf "Usage:
sudo ./install_docker-ce.sh ${LGREEN}\$USER${NC}
Please run as ${RED}root${NC}\n";
exit
else
printf "${GREEN}Installing curl.${NC}\n";
apt update && apt install -y curl && printf "${LGREEN}DONE${NC}\n" && sleep 5;
printf "${GREEN}Adding Docker Repo key.${NC}\n";
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - && printf "${LGREEN}DONE${NC}\n" && sleep 5;
printf "${GREEN}Adding Docker Repo.${NC}\n";
apt-add-repository -y -n \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
bionic \
stable" && apt update && printf "${LGREEN}DONE${NC}\n" && sleep 5;
printf "${GREEN}Installing Docker Community Edtion.${NC}\n";
apt install -y \
apt-transport-https \
ca-certificates \
containerd.io \
docker-ce \
docker-ce-cli \
gnupg-agent \
software-properties-common && printf "${LGREEN}DONE${NC}\n" && sleep 5;
printf "${GREEN}Adding $1 to group docker.${NC}\n";
usermod -aG docker $1 && printf "${LGREEN}DONE${NC}\n" && sleep 5;
printf "Please logout or reboot to start using Docker CE\n";
fi