-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdock.sh
More file actions
31 lines (23 loc) · 1.1 KB
/
dock.sh
File metadata and controls
31 lines (23 loc) · 1.1 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
#!/bin/bash
# Update system package index
sudo apt-get update
# Install required packages
sudo apt-get install -y ca-certificates curl gnupg
# Set up Docker's GPG key
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
# Add Docker repository to Apt sources
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Update package lists again
sudo apt-get update
# Install Docker packages
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Add current user to the docker group
sudo usermod -aG docker $USER
# Apply group changes (requires logout/restart to take full effect)
echo "Docker installed and user added to the 'docker' group."
echo "Please log out and log back in (or restart) for the changes to take effect."