Last active
June 11, 2024 10:21
-
-
Save loudar/48c63bd34d55ba38abc33c94112b84d5 to your computer and use it in GitHub Desktop.
Simple setup script for docker on Ubuntu machines
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
#!/bin/bash | |
# Update and upgrade packages without user confirmation | |
sudo apt update -y && sudo apt upgrade -y | |
# Install ca-certificates and curl | |
sudo apt-get update -y | |
sudo apt-get install -y ca-certificates curl | |
# Add Docker's official GPG key | |
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 Docker 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 | |
# Update package list | |
sudo apt-get update -y | |
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin | |
sudo docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
curl -fsSL https://gist.githubusercontent.com/loudar/48c63bd34d55ba38abc33c94112b84d5/raw/c6801c0cff3fa836c31e47f2040ef5cb34268466/setup-docker-ubuntu.sh | bash