-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_docker
30 lines (20 loc) · 905 Bytes
/
install_docker
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
#!/bin/bash
echo updating repositories
apt update > /dev/null 2>&1
echo installing docker prerequisites
apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common > /dev/null 2>&1
echo adding docker key
curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add - > /dev/null 2>&1
echo adding docker repositories
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
echo updating repositories
apt update > /dev/null 2>&1
echo installing docker
apt install -y docker-ce docker-ce-cli containerd.io > /dev/null 2>&1
echo creating containers user
adduser --disabled-password --gecos '' containers > /dev/null 2>&1
echo changing containers user password
echo containers:containers | chpasswd
echo adding containers user to containers group
usermod -aG docker containers
echo docker installation complete