Skip to content

Instantly share code, notes, and snippets.

@aytackanaci
Created January 19, 2022 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aytackanaci/da721666fcba03044a34d784ca7d5f0c to your computer and use it in GitHub Desktop.
Save aytackanaci/da721666fcba03044a34d784ca7d5f0c to your computer and use it in GitHub Desktop.
Set docker in wsl

install docker

sudo apt install docker.io -y

docker sudo shit

sudo visudo

# add below ad the end
# Docker daemon specification
sungkim ALL=(ALL) NOPASSWD: /usr/bin/dockerd

add below to .bashrc

# Start Docker daemon automatically when logging in if not running.
RUNNING=`ps aux | grep dockerd | grep -v grep`
if [ -z "$RUNNING" ]; then
    sudo dockerd > /dev/null 2>&1 &
    disown
fi

modify user

sudo usermod -aG docker $USER

try docker

docker run hello-world
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment