Skip to content

Instantly share code, notes, and snippets.

@yuri1969
Last active March 23, 2022 20:51
Show Gist options
  • Save yuri1969/019e3f302315e19ef02a289a9bca38f3 to your computer and use it in GitHub Desktop.
Save yuri1969/019e3f302315e19ef02a289a9bca38f3 to your computer and use it in GitHub Desktop.
WSL2 Debian with Docker CE
# Remove the evil Docker 'non-CE' packages
sudo apt remove docker docker-engine docker.io containerd runc
sudo apt update
# Make sure all the requirements are present
sudo apt install --no-install-recommends apt-transport-https ca-certificates curl gnupg2
# Add Docker package repo
source /etc/os-release
curl -fsSL "https://download.docker.com/linux/${ID}/gpg" | sudo apt-key add -
echo "deb [arch=amd64] https://download.docker.com/linux/${ID} ${VERSION_CODENAME} stable" | sudo tee /etc/apt/sources.list.d/docker.list
sudo apt update
# Install Docker CE packages
sudo apt install docker-ce docker-ce-cli containerd.io
# Allow the current user to control Docker
sudo usermod -aG docker "$USER"
# Use legacy iptables - https://github.com/WhitewaterFoundry/Pengwin/issues/485#issuecomment-518028465
sudo update-alternatives --set iptables /usr/sbin/iptables-legacy
sudo update-alternatives --set ip6tables /usr/sbin/ip6tables-legacy
# Make sure the Docker deamon starts - https://github.com/arkane-systems/genie
sudo systemctl restart docker.service
# Relog the current user
logout
###
# Stuck service can reset via: sudo systemctl reset-failed docker.service
###
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment