Skip to content

Instantly share code, notes, and snippets.

@dkrusky
Last active March 22, 2024 20:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dkrusky/56315eb7fa12eff4f927491a72bf3696 to your computer and use it in GitHub Desktop.
Save dkrusky/56315eb7fa12eff4f927491a72bf3696 to your computer and use it in GitHub Desktop.
Docker install for Ubuntu 22.04 and up
#!/bin/bash
# deal with pre-requisites
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y
# install public signature for docker repo and setup repo
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 > /dev/null
# install docker from repo
sudo apt update
sudo apt install docker-ce
sudo systemctl status docker
# add permission for current user to run docker
sudo usermod -aG docker ${USER}
# force logout so next connection will have permissions to run docker as this user
logout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment