skip to Main Content

I use the Google Cloud Code extension on VSCode.
I have a minikube running on my macbook (using the virtualbox driver).

I can run skaffold debug from my terminal just fine; the Helm chart gets deployed, but I haven’t done the debugger setup so the breakpoints don’t hit (as expected).

I want to use the Cloud Code extension to avoid manually doing the debugger setup.
However, if I run "debug on Kubernetes" in the Cloud Code extension, I get a prompt saying "Docker was found in the path but does not appear to be running. Start Docker to continue":
VSCode prompt asking me to start docker

If I select "start Docker", then Docker Desktop will be started, which I want to avoid. It seems to me that Cloud Code needs to do the equivalent of running eval $(minikube -p minikube docker-env) to use the minikube Docker daemon. Is there a setting to get it to do that?

2

Answers


  1. I think you have to expose docker via your instance of minikube into the environment that Cloud Code is running on for the extension to be aware of them. Instruction is in https://minikube.sigs.k8s.io/docs/tutorials/docker_desktop_replacement/

    And from the terminal instance that you issue the command open VSCode (code command)

    Login or Signup to reply.
  2. my work around.

    ls -l /var/run/docker.sock
    # /var/run/docker.sock -> $HOME/.docker/run/docker.sock
    sudo rm /var/run/docker.sock
    
    ssh -i ~/.minikube/machines/minikube/id_rsa -L $HOME/.minikube/docker.sock:/var/run/docker.sock docker@$(minikube ip) -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null
    
    sudo ln -s $HOME/.minikube/docker.sock /var/run/docker.sock
    
    if curl -s --unix-socket /var/run/docker.sock http/_ping 2>&1 >/dev/null
    then
      echo "Running"
    else
      echo "Not running"
    fi
    # Running
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search