Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-72178

Pipeline can not run in docker agent

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Minor Minor
    • docker-workflow-plugin
    • None
    • RHEL 8.5
      Docker version 20.10.21
      docker image: jenkins:lts-jdk17
      Docker Pipeline Version572.v950f58993843
      Docker Commons Plugin Version439.va_3cb_0a_6a_fb_29

      I follow Installing Jenkins as Docker

      And try to execute pipeline in docker: https://www.jenkins.io/doc/book/pipeline/docker/

      But get error message as below

      ======
      Started by user
      admin
      [Pipeline] Start of Pipeline[Pipeline] nodeRunning on Jenkins in /var/jenkins_home/workspace/My-Pipeline[Pipeline] {[Pipeline] isUnix[Pipeline] withEnv[Pipeline]

      {[Pipeline] sh+ docker inspect -f . node:18.18.1-alpine3.18 .[Pipeline] }

      [Pipeline] // withEnv[Pipeline] withDockerContainerJenkins seems to be running inside container d1b8f135e3793c8e5e5f93ba5c19e5ea588f75f9653fe96e439468e6a5a68ae2
      but /var/jenkins_home/workspace/My-Pipeline could not be found among []
      but /var/jenkins_home/workspace/My-Pipeline@tmp could not be found among []
      $ docker run -t -d -u 1000:1000 -w /var/jenkins_home/workspace/My-Pipeline -v /var/jenkins_home/workspace/My-Pipeline:/var/jenkins_home/workspace/My-Pipeline:rw,z -v /var/jenkins_home/workspace/My-Pipeline@tmp:/var/jenkins_home/workspace/My-Pipeline@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** node:18.18.1-alpine3.18 cat[Pipeline] // withDockerContainer[Pipeline] }[Pipeline] // node[Pipeline] End of PipelineAlso: org.jenkinsci.plugins.workflow.actions.ErrorAction$ErrorId: 43ef549a-3b59-4a26-8582-ee3a26b9bfc5
      java.io.IOException: Failed to run image 'node:18.18.1-alpine3.18'. Error: docker: Error response from daemon: error while creating mount source path '/var/jenkins_home/workspace/My-Pipeline': mkdir /var/jenkins_home: file exists.
      at org.jenkinsci.plugins.docker.workflow.client.DockerClient.run(DockerClient.java:148)
      at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:200)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:323)
      at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:196)
      at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:124)
       

       

            Unassigned Unassigned
            bradhuang9999 Brad
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: