Created
January 18, 2022 23:00
-
-
Save mrimp/4c7944ff05055db0f5c49082c7e52dd3 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requirments | |
# WSL2 on Windows | |
# check version | |
wsl -l -v | |
# WSL2 if not upgrade | |
# open ubuntu term | |
sudo apt update && sudo apt upgrade -y | |
# install docker | |
sudo apt install docker.io -y | |
# check docker install | |
docker --version | |
# modify sudoers | |
sudo visudo | |
# add to the bottom and change "username" | |
# Docker daemon specification | |
username ALL=(ALL) NOPASSWD: /usr/bin/dockerd | |
# edit .bashrc or .zshrc and add at end of file | |
nano ~/.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 | |
# add user to docker group | |
sudo usermod -aG docker $USER | |
docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment