forked from thumubhatthi/all-setups
-
Notifications
You must be signed in to change notification settings - Fork 144
Expand file tree
/
Copy pathubuntu-docker.sh
More file actions
24 lines (17 loc) · 810 Bytes
/
ubuntu-docker.sh
File metadata and controls
24 lines (17 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash
# Update the system
apt-get update
apt-get upgrade -y
# Install Docker dependencies
apt-get install -y apt-transport-https ca-certificates curl software-properties-common
# Add Docker's official GPG key
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Add Docker repository
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package information and install Docker
apt-get update
apt-get install -y docker-ce docker-ce-cli containerd.io
# Start Docker service
systemctl start docker
# Enable Docker to start on system boot
systemctl enable docker