forked from samuel52/docker-installation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker.sh
More file actions
43 lines (28 loc) · 1.04 KB
/
docker.sh
File metadata and controls
43 lines (28 loc) · 1.04 KB
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
41
42
#!/bin/sh
echo "First, update your existing list of packages"
sudo apt update
echo "install a few prerequisite packages"
sudo apt install apt-transport-https ca-certificates curl software-properties-common
echo "GPG key for the official Docker repository"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "Docker repository to APT sources"
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
echo "update the package"
sudo apt update
apt-cache policy docker-ce
echo "install Docker"
sudo apt install docker-ce
echo "install docker-compose"
sudo curl -L https://github.com/docker/compose/releases/download/1.21.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
echo "permission"
sudo chmod +x /usr/local/bin/docker-compose
echo "check docker status"
sudo systemctl status docker
echo "remove perm"
sudo usermod -aG docker ubuntu && su - ubuntu
echo "Confirm"
id -nG
echo "Remove sudo right"
sudo gpasswd -a $USER docker
echo "Exit machine"
exit