Skip to content

Instantly share code, notes, and snippets.

@o-az
Created October 11, 2024 07:10
Show Gist options
  • Save o-az/029586e6a6950e03f017a4b97a7800c2 to your computer and use it in GitHub Desktop.
Save o-az/029586e6a6950e03f017a4b97a7800c2 to your computer and use it in GitHub Desktop.
install docker on Ubuntu. This will require `sudo` to run `docker`. To run without `sudo`, see `no-sudo.md` for directions
sudo apt update --yes
sudo apt upgrade --yes
sudo apt install --yes \
curl \
apt-transport-https \
ca-certificates \
software-properties-common
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
sudo apt update --yes
apt-cache policy docker-ce
sudo apt install --yes docker-ce
sudo systemctl status docker

To make docker runnable without sudo:

sudo usermod -aG docker ${USER}
su - ${USER}
exec $SHELL
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment