title: Docker: not found when running cmds in jenkinsfile
body: <p>I am new to docker and CI. I am trying to create a jenkinsfile that would build and test my application, then build a docker image with the Dockerfile i've composed and then push it into AWS ECR. The steps I am stuck on is building an image with docker, i receive and error message <code>docker: not found</code>. I downloaded docker plug-in and configured it in the global tool configuration tab. Am i not adding it into tools correctly?</p>
  <p>There was another post wear you could use kubernetes to do that however kubernetes no longer supports docker.</p>
  <p>image of how i configured docker in global tools config:
  <a href="https://i.stack.imgur.com/xmOl3.png" rel="nofollow noreferrer">global tool config</a></p>
  <p>error</p>
  <pre><code>/var/jenkins_home/workspace/client-pipeline_feature-jenkins@tmp/durable-41220eb0/script.sh: 1: /var/jenkins_home/workspace/client-pipeline_feature-jenkins@tmp/durable-41220eb0/script.sh: docker: not found
  </code></pre>
  <p><a href="https://i.stack.imgur.com/IcJLW.png" rel="nofollow noreferrer">error with permission to sock</a></p>
  <pre><code>def gv
  containerVersion = &quot;1.0&quot;
  appName = &quot;foodcore&quot;
  imageName = appName + &quot;:&quot; + version
  pipeline {
      agent any
      environment {
          CI = 'true'
      }
      tools {
        nodejs &quot;node&quot;
        docker &quot;docker&quot;
      }
      stages {
          stage(&quot;init&quot;) {
              steps {
                  script {
                     gv = load &quot;script.groovy&quot;
                     CODE_CHANGES = gv.getGitChanges()
                  }
              }
          }
          stage(&quot;build frontend&quot;) {
              steps {
                  dir(&quot;client&quot;) {
                      sh 'npm install'
                  }
              }
          }
          stage(&quot;build backend&quot;) {
              steps {
                  dir(&quot;server&quot;) {
                      sh 'npm install'
                  }
              }
          }
          stage(&quot;test&quot;) {
              when {
                  expression {
                      script {
                          CODE_CHANGES == false
                      }
                  }
              }
              steps {
                  dir(&quot;client&quot;) {
                      sh 'npm test'
                  }
              }
          }
          stage(&quot;build docker image&quot;) {
              when {
                  expression {
                      script {
                         env.BRANCH_NAME.toString().equals('Main') &amp;&amp; CODE_CHANGES == false
                      }
                  }
              }
              steps {
                  sh &quot;docker build -t ${imageName} .&quot;
              }
          }
          stage(&quot;push docker image&quot;) {
              when {
                  expression {
                      env.BRANCH_NAME.toString().equals('Main')
                  }
              }
              steps {
                  sh 'aws ecr get-login-password --region us-east-2 | docker login --username AWS --password-stdin repoURI'
                  sh 'docker tag foodcore:latest ...repoURI
                  sh 'docker push repoURI'
              }
          }
      }   
  }
  </code></pre>