Created
April 24, 2023 06:41
-
-
Save stephenchew/b53241cf568feda83c2b753c7bd43e8d to your computer and use it in GitHub Desktop.
Docker start-up script for WSL2
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
./start-docker.sh |
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
####################################################################################################################################### | |
# Inspired by https://dev.to/bowmanjd/install-docker-on-windows-wsl-without-docker-desktop-34m9#launch-script-for-raw-dockerd-endraw- # | |
####################################################################################################################################### | |
#!/bin/bash | |
DOCKER_DISTRO=Ubuntu-22.04 | |
docker ps >/dev/null 2>&1 && DOCKER_RUNNING=1 || DOCKER_RUNNING=0 | |
if [ $DOCKER_RUNNING == '0' ] | |
then | |
echo 'Starting docker...' | |
/mnt/c/Windows/System32/wsl.exe -d $DOCKER_DISTRO sh -c "nohup sudo -b dockerd < /dev/null >/dev/null 2>&1" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment