Created
January 21, 2020 15:39
-
-
Save Michael-Stokoe/c858eb8ee1b14e87d6edb6b90cd62c5e to your computer and use it in GitHub Desktop.
This file contains 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
# Add these lines to your .bashrc to automatically start Docker in WSL/WSL2. | |
function docker_startup() { | |
i=`ps -eaf | grep -i docker |sed '/^$/d' | wc -l` | |
if [[ $i > 1 ]] | |
then | |
echo "Docker is already running." | |
else | |
sudo service docker start | |
echo "Docker started!" | |
fi | |
} | |
docker_startup |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment