forked from MadDamDam/opsschool-monitoring
-
Notifications
You must be signed in to change notification settings - Fork 20
/
inst_docker.sh
32 lines (29 loc) · 1001 Bytes
/
inst_docker.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
#!/bin/bash
sudo apt-get update
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
sudo apt-get update
sudo apt-get install docker-ce -y
sudo usermod -aG docker $USER
sudo docker run hello-world
sudo curl -L https://github.com/docker/compose/releases/download/1.24.1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version
sudo mkdir /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/docker.root.conf &>/dev/null << EOF
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd --data-root /data/docker-root -H fd://
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
sudo docker info
sudo docker run hello-world