Answers: <p>If you simply google "jenkins does not seem to be running inside a container", you will see that it's only an informational message. Surely, it could be worded better, but it's pretty much harmless. </p>
  
Answers: CC BY-SA 4.0
Answers: 2019-11-11T08:21:18.920Z
Answers: Hey i tried that's why i put here in Devops community ,from my end i had done all R&D to fix this error . Hope you  better suggestion . Thanksg
Answers: Akshay Kumar
Answers: CC BY-SA 4.0
Answers: 2019-11-11T08:22:39.110Z
Answers: As stated in my answer, it's not an error.
Answers: schaiba
Answers: CC BY-SA 4.0
Answers: 2019-11-11T08:24:57.147Z
Answers: Yes but i tried to deploy and push the app into dockerhub but its failing but if i tried same from my local machine without CI/CD its working perfectly,so it means my process and code with Dockerfile is correct ,issue somewhere in that Jenkins file which i have written or might be jenkins plugin nor sure .
Answers: Akshay Kumar
Answers: CC BY-SA 4.0
Answers: 2019-11-11T09:00:31.947Z
Answers: ERROR : script returned exit code 127 Finished : FAILURE   this error i am getting while running the pipeline from jenkins .
Answers: Akshay Kumar
Answers: CC BY-SA 4.0
Answers: 2019-11-11T08:19:33.273Z
Answers: 2019-11-11T08:19:33.273Z
Answers: schaiba
Body: <p>I am getting an error while running the Jenkins file tp build and push the docker image into docker hub .</p>
  
  <p>you can reveiw my code github : <a href="https://github.com/iakshaykr/webapp.git" rel="nofollow noreferrer">https://github.com/iakshaykr/webapp.git</a> (using jenkins_pipe branch not master branch )</p>
  
  <p>Jenkinsfile : </p>
  
  <pre><code>pipeline {
      environment {
          registry= "iakshaykr/webapp"
          registryCredential= 'dockerhub'
      }
  
      agent { dockerfile true }
  
      stages {
          stage('Bilding image') {
              steps {
               script {
                   docker.build registry + ":$BUILD_NUMBER"
                }
              }
          }
      }
  }
  </code></pre>
  
  <p><a href="https://i.sstatic.net/Az98F.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Az98F.png" alt="Screenshot of the jenkins job log"></a></p>
  
  <hr>
  
  <p>Below solution valid on Error code 127.If you are getting any other error code let me know .</p>
  
  <p>After doing R&amp;D finally got the solution.</p>
  
  <p>1st test your code in Jenkins using shell command which is in build option :</p>
  
  <p>cmd : docker build . -t newimage</p>
  
  <p>2nd test : use the docker plugin (Plugin name :CloudBees Docker Build and Publish)</p>
  
  <p>3rd test : use the build option : pipeline scm </p>
  
  <p>code : <a href="https://github.com/iakshaykr/webapp.git" rel="nofollow noreferrer">https://github.com/iakshaykr/webapp.git</a>
  Use : jenkins_pipe branch </p>
  
  <p>Please test the thing ,in case any error please reply back .</p>
  
  <p>Note : First setup/add the credentials for dockerhub in your jenkins for authentication .</p>
  
Tags: <docker><jenkins><jenkins-pipeline><dockerfile><jenkinsfile>
Title: Jenkins does not seem to be running inside a container
UserDisplayName: Akshay Kumar
ThreadText: # Jenkins does not seem to be running inside a container
  
  (Asked by: username_0 on 2019-11-09)
  
  I am getting an error while running the Jenkins file tp build and push the docker image into docker hub .
  
  you can reveiw my code github : <https://github.com/iakshaykr/webapp.git> (using jenkins\_pipe branch not master branch )
  
  Jenkinsfile :
  
  ```
  pipeline {
      environment {
          registry= "iakshaykr/webapp"
          registryCredential= 'dockerhub'
      }
  
      agent { dockerfile true }
  
      stages {
          stage('Bilding image') {
              steps {
               script {
                   docker.build registry + ":$BUILD_NUMBER"
                }
              }
          }
      }
  }
  
  ```
  
  [![Screenshot of the jenkins job log](https://i.sstatic.net/Az98F.png)](https://i.sstatic.net/Az98F.png)
  
  ---
  
  Below solution valid on Error code 127.If you are getting any other error code let me know .
  
  After doing R&D finally got the solution.
  
  1st test your code in Jenkins using shell command which is in build option :
  
  cmd : docker build . -t newimage
  
  2nd test : use the docker plugin (Plugin name :CloudBees Docker Build and Publish)
  
  3rd test : use the build option : pipeline scm
  
  code : <https://github.com/iakshaykr/webapp.git>
  Use : jenkins\_pipe branch
  
  Please test the thing ,in case any error please reply back .
  
  Note : First setup/add the credentials for dockerhub in your jenkins for authentication .
  
  **Tags:** docker, jenkins, jenkins-pipeline, dockerfile, jenkinsfile
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-11-11. Score: 1
  
  If you simply google "jenkins does not seem to be running inside a container", you will see that it's only an informational message. Surely, it could be worded better, but it's pretty much harmless.
  
  > **Comments:**
  > **username_0**: Hey i tried that's why i put here in Devops community ,from my end i had done all R&D to fix this error . Hope you  better suggestion . Thanksg  
  > **username_1**: As stated in my answer, it's not an error.  
  > **username_0**: Yes but i tried to deploy and push the app into dockerhub but its failing but if i tried same from my local machine without CI/CD its working perfectly,so it means my process and code with Dockerfile is correct ,issue somewhere in that Jenkins file which i have written or might be jenkins plugin nor sure .  
  > **username_0**: ERROR : script returned exit code 127 Finished : FAILURE   this error i am getting while running the pipeline from jenkins .  
  
  ---
  
  