-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#7944: Add docker convenience installation script for devs
- Loading branch information
1 parent
925a14e
commit a8482f2
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
# Setup sources for docker | ||
sudo apt-get update -y | ||
sudo apt-get install ca-certificates curl | ||
sudo install -m 0755 -d /etc/apt/keyrings | ||
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc | ||
sudo chmod a+r /etc/apt/keyrings/docker.asc | ||
|
||
# Add the repository to Apt sources: | ||
echo \ | ||
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ | ||
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \ | ||
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null | ||
sudo apt-get update -y | ||
|
||
# Install docker and plugins | ||
sudo apt-get install -y \ | ||
docker-ce=5:26.1.1-1~ubuntu.20.04~focal \ | ||
docker-ce-cli=5:26.1.1-1~ubuntu.20.04~focal \ | ||
containerd.io=1.6.31-1 \ | ||
docker-buildx-plugin=0.14.0-1~ubuntu.20.04~focal \ | ||
docker-compose-plugin=2.27.0-1~ubuntu.20.04~focal | ||
|
||
# Set up docker for non-root user | ||
sudo groupadd docker | ||
sudo usermod -aG docker $USER | ||
newgrp docker |