Issue
I'm using a Jenkins in a container and I'm trying to deploy a docker app using Jenkins.
I'm stuck at an error at the end of my pipeline :
No tool named docker found
Here is a part of my Jenkinsfile where the issue appear :
stages {
stage('Initialize') {
steps{
script {
def dockerHome = tool 'docker'
env.PATH = "${dockerHome}/bin:${env.PATH}"
I installed docker on my linux server and in my Jenkins container.
That's what I did to create my Jenkins container :
docker run -d --name jenkins-master -p 4800:8080 -p 50000:50000 -v jenkins_home:/var/jenkins_home -v /var/run/docker.sock:/var/run/docker.sock jenkins/jenkins:2.235.5
I can access to docker command in my Jenkins. I also installed the Docker-plugin in Jenkins.
Solution
I fixed my issue.
I didn't configure correctly Docker in global tool configuration, in Jenkins.
It works now.
Answered By - Myriam K.
Answer Checked By - David Marino (JavaFixing Volunteer)