Skip to content

Instantly share code, notes, and snippets.

@maxdzin
Last active May 18, 2024 13:07
Show Gist options
  • Select an option

  • Save maxdzin/99bcf2dc3ac5103703c01e9dfd122b36 to your computer and use it in GitHub Desktop.

Select an option

Save maxdzin/99bcf2dc3ac5103703c01e9dfd122b36 to your computer and use it in GitHub Desktop.
WSL CLI Docker

WSL Docker installation for CLI usage

Docker engine install

Guide

Post-installation steps

wsl --shutdown

sudo su -

sudo touch /etc/wsl.conf

sudo chmod 777 /etc/wsl.conf

sudo echo "[boot]
command=\"/etc/init.d/docker start\"" > /etc/wsl.conf
# You might setup some more suitable permissions than chmod 777, chmod was only  given to ensure the test works

sudo groupadd docker
# sudo gpasswd -a $USER docker
sudo usermod $USER -aG docker
# sudo usermod -aG docker $USER

Note: The content of /etc/wsl.conf should look like:

[boot]
command="service docker start"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment