-
Notifications
You must be signed in to change notification settings - Fork 3
/
0-docker
executable file
·39 lines (27 loc) · 1.03 KB
/
0-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
31
32
33
34
35
36
37
38
39
#! /bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi
COMPOSE_VERSION="2.0.1"
SYSTEM=$(uname -s | tr '[:upper:]' '[:lower:]')
apt-get update && apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
gnupg-agent \
software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
apt-get update && apt-get install -y docker-ce docker-ce-cli containerd.io
usermod -aG docker $USER
usermod -aG docker iotronic
systemctl enable docker
curl -L "https://github.com/docker/compose/releases/download/v${COMPOSE_VERSION}/docker-compose-${SYSTEM}-$(uname -m)" -o /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
docker network create iotronic_network
echo -e "\e[32mCompleted - Log out and log back in so that your group membership is re-evaluated.\e[0m"