forked from MunifTanjim/scripts.sh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-docker
executable file
·29 lines (20 loc) · 953 Bytes
/
setup-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
#!/usr/bin/env bash
set -euo pipefail
echo "Updating APT Cache..."
sudo apt-get update
echo "Installing dependencies..."
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
echo "Adding Docker's official GPG key..."
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
echo "Adding APT Repository..."
codename=$(lsb_release -cs)
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu ${codename} stable"
echo "Installing Docker..."
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
echo "Setting up for non-root user..."
sudo usermod -aG docker "${USER}"
echo "Installing Docker Compose..."
sudo curl -L "https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "Done!"