exposing docker daemon of minikube from jenkins

Viewed 120

I have local minikube setup in my mac. Minikube is installed and running successfully. Then i install Jenkins in minikube creating a new namespace. All went good and jenkins is also running sucessfully. Now i created a testing pipeline :

pipeline {
   agent any

   stages {
      stage('Hello') {
         steps {
             sh 'eval $(minikube docker-env)'
         }
      }
   }
}

When i check the console i am getting error as :

+ minikube docker-env
/var/jenkins_home/workspace/my-test@tmp/durable-532ecd6e/script.sh: 1: /var/jenkins_home/workspace/my-test@tmp/durable-532ecd6e/script.sh: minikube: not found

If i run minikube docker-env in the terminal, all goes good but from inside jenkins i cant access the docker-daemon of minikube. How to fix this.

0 Answers
Related