Skip to content

Instantly share code, notes, and snippets.

@rnarayana
Last active February 1, 2022 05:24
Show Gist options
  • Save rnarayana/6c38d4b05e6ca080e8209a983feccec8 to your computer and use it in GitHub Desktop.
Save rnarayana/6c38d4b05e6ca080e8209a983feccec8 to your computer and use it in GitHub Desktop.
Setting up docker and k8s on WSL
  1. Install docker, kubectl, helm, minikube and dapr using instructions here
  2. Update ~/.bashrc to include the below script to start docker and minikube if not running on startup.
# Start Docker daemon automatically when logging in if not running.
DOCKER_RUNNING=`ps aux | grep dockerd | grep -v grep`
if [ -z "$DOCKER_RUNNING" ]; then
    echo "Starting docker daemon..."
    sudo dockerd > /dev/null 2>&1 &
    disown
fi

# Start Minikube automatically when logging in if not running.
MINIKUBE_RUNNING=`ps aux | grep minikube | grep -v grep`
if [ -z "$MINIKUBE_RUNNING" ]; then
    echo "Starting minikube cluster..."
    minikube start
fi

eval $(minikube docker-env)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment