Skip to content

Instantly share code, notes, and snippets.

@zdk
Last active November 26, 2023 05:25
Show Gist options
  • Save zdk/4f279c688a0c2076e79fde6aba194be0 to your computer and use it in GitHub Desktop.
Save zdk/4f279c688a0c2076e79fde6aba194be0 to your computer and use it in GitHub Desktop.
#!/bin/bash
# update, add docker gpg key, and docker apt repo
sudo apt update
sudo apt install apt-transport-https ca-certificates curl 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
apt-cache policy docker-ce
if [[ $(grep -i microsoft /proc/version) ]]; then
echo "Enable systemd in case of WSL"
cat >/etc/wsl.conf <<EOL
[boot]
systemd=true
EOL
fi
# install docker
sudo apt install docker-ce
sudo systemctl status docker
sudo usermod -aG docker "${USER}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment