Skip to content

Instantly share code, notes, and snippets.

@mihow
Last active July 8, 2022 00:07
Show Gist options
  • Save mihow/21116a999256d492b894cc23cffaf1af to your computer and use it in GitHub Desktop.
Save mihow/21116a999256d492b894cc23cffaf1af to your computer and use it in GitHub Desktop.
Install Docker on Ubuntu (Tested on 20.04 LTS Focal)
#! /bin/bash
set -o errexit
set -o nounset
set -o xtrace
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
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
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose
sudo docker run hello-world
sudo usermod -aG docker $USER
newgrp docker
docker run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment