Skip to content

Instantly share code, notes, and snippets.

@det-peralta
Last active December 27, 2021 11:49
Show Gist options
  • Save det-peralta/9c129b7dbc0190a87d498eeae4fd37b1 to your computer and use it in GitHub Desktop.
Save det-peralta/9c129b7dbc0190a87d498eeae4fd37b1 to your computer and use it in GitHub Desktop.
Install Docker Engine on Debian WSL2
#!/bin/sh
#Uninstall docker old versions
sudo apt remove --yes docker docker-engine docker.io containerd runc || true
#Set up the docker repository
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/debian \
$(lsb_release -cs) \
stable"
#Install Docker Engine
sudo apt update
sudo apt --yes --no-install-recommends install docker-ce docker-ce-cli containerd.io docker-compose
#The following command enables us to use sudo for docker commands
sudo usermod -aG docker $USER
#Close and reopen WSL2 Terminal
#Enable Docker on boot
sudo systemctl enable docker.service
sudo systemctl enable containerd.service
#Start Docker
#sudo service docker start
#Test docker instalation
#docker run --rm hello-world
#docker image rm hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment