Skip to content

Instantly share code, notes, and snippets.

@febri4n
Last active April 1, 2024 15:23
Show Gist options
  • Save febri4n/408b72f71be7ef846a7b35c9cfa35e1a to your computer and use it in GitHub Desktop.
Save febri4n/408b72f71be7ef846a7b35c9cfa35e1a to your computer and use it in GitHub Desktop.
install-docker
#!/bin/bash
# Step 1
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
# Step 2
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Step 3
echo "deb [arch=$(dpkg --print-architecture) 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
# Step 4
sudo apt update -y
# Step 5
sudo apt install -y docker-ce
# Check available version in repo
# sudo apt-cache policy docker-ce
# Specific docker version
# sudo apt install -y docker-ce=5:24.0.0-1~ubuntu.22.04~jammy
# Step 6
sudo systemctl enable docker
# Step 7
sudo usermod -aG docker ubuntu
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment