run jenkins pipeline fails "docker": error=2, No such file or directory

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

run jenkins pipeline fails "docker": error=2, No such file or directory

Lynn Lin-2
hi

I am following this guide to have a run jenkins pipeline in my mac  https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/e40b57a2-e315-41d6-981d-a88bc48964e3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

Oleg Nenashev
Hi,

Docker CLI tool needs to be installed on the machine and available in PATH if you do not specify a Docker tool installation to be used.
See the withTool() documentation if you need to specify a tool path: https://github.com/jenkinsci/docker-workflow-plugin/blob/f32bca9148471ff7381f5404a747b0151305996e/src/main/resources/org/jenkinsci/plugins/docker/workflow/DockerDSL/help.jelly#L31-L37

Best regards,
Oleg Nenashev


пятница, 24 ноября 2017 г., 11:27:02 UTC+3 пользователь Lynn Lin написал:
hi

I am following this guide to have a run jenkins pipeline in my mac  <a href="https://jenkins.io/doc/pipeline/tour/agents/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Ftour%2Fagents%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGTK7EigseFWRcNufSAkU0WFhGxpQ&#39;;return true;" onclick="this.href=&#39;https://www.google.com/url?q\x3dhttps%3A%2F%2Fjenkins.io%2Fdoc%2Fpipeline%2Ftour%2Fagents%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGTK7EigseFWRcNufSAkU0WFhGxpQ&#39;;return true;">https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9ece03-b187-42c0-9670-4fa1d683942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

Lynn Lin-2

Oleg Nenashev <[hidden email]>于2017年11月26日 周日上午8:55写道:
Hi,

Docker CLI tool needs to be installed on the machine and available in PATH if you do not specify a Docker tool installation to be used.
See the withTool() documentation if you need to specify a tool path: https://github.com/jenkinsci/docker-workflow-plugin/blob/f32bca9148471ff7381f5404a747b0151305996e/src/main/resources/org/jenkinsci/plugins/docker/workflow/DockerDSL/help.jelly#L31-L37

Thanks, but you can see from the log that Docker pull already succeeded so curious why Docker inspect fails 

Best regards,
Oleg Nenashev


пятница, 24 ноября 2017 г., 11:27:02 UTC+3 пользователь Lynn Lin написал:
hi

I am following this guide to have a run jenkins pipeline in my mac  https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/O-_7JBEncV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9ece03-b187-42c0-9670-4fa1d683942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAPgpnMSpzd3jxDaaOJ%2Bi-5g%3D2zWyOytSFPT-GBhOXMBPpp4GEg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

anilkumar panditi
Hi,
I have Jenkins running as docker container and in my Jenkins File , in initialize stage i have following which is working also , i have installed docker from Docker hub latest. Not sure where is the problem . Pipeline is failing with the following.

ava.io.IOException: error=2, No such file or directory

at java.lang.UNIXProcess.forkAndExec(Native Method)

at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)

at java.lang.ProcessImpl.start(ProcessImpl.java:134)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at hudson.Proc$LocalProc.<init>(Proc.java:250)

at hudson.Proc$LocalProc.<init>(Proc.java:219)

at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)

at hudson.Launcher$ProcStarter.start(Launcher.java:454)

at hudson.Launcher$ProcStarter.join(Launcher.java:465)

at org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)

at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)

at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)


On Monday, 27 November 2017 at 01:21:50 UTC+5:30 [hidden email] wrote:

Oleg Nenashev <[hidden email]>于2017年11月26日 周日上午8:55写道:
Hi,

Docker CLI tool needs to be installed on the machine and available in PATH if you do not specify a Docker tool installation to be used.
See the withTool() documentation if you need to specify a tool path: https://github.com/jenkinsci/docker-workflow-plugin/blob/f32bca9148471ff7381f5404a747b0151305996e/src/main/resources/org/jenkinsci/plugins/docker/workflow/DockerDSL/help.jelly#L31-L37

Thanks, but you can see from the log that Docker pull already succeeded so curious why Docker inspect fails 

Best regards,
Oleg Nenashev


пятница, 24 ноября 2017 г., 11:27:02 UTC+3 пользователь Lynn Lin написал:
hi

I am following this guide to have a run jenkins pipeline in my mac  https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/O-_7JBEncV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9ece03-b187-42c0-9670-4fa1d683942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/9b5aa15e-d273-4f40-b0b9-5bb08286e010n%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

Ivan Fernandez Calvo
If you are running Jenkins ins a Docker container with the official Docker container, the docker CLI command is not installed and that's your error, you need the docker CLI installed to access a Docker Host. One trick can be to mount the binary of the Docker Host where you are running that Jenkins and the Docker socket, but this configuration is for local testing never for a production environment. Something like this

docker run -it -v $(command -v docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock jenkins:lts


El jueves, 28 de enero de 2021 a las 11:59:06 UTC+1, [hidden email] escribió:
Hi,
I have Jenkins running as docker container and in my Jenkins File , in initialize stage i have following which is working also , i have installed docker from Docker hub latest. Not sure where is the problem . Pipeline is failing with the following.

ava.io.IOException: error=2, No such file or directory

at java.lang.UNIXProcess.forkAndExec(Native Method)

at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)

at java.lang.ProcessImpl.start(ProcessImpl.java:134)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at hudson.Proc$LocalProc.<init>(Proc.java:250)

at hudson.Proc$LocalProc.<init>(Proc.java:219)

at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)

at hudson.Launcher$ProcStarter.start(Launcher.java:454)

at hudson.Launcher$ProcStarter.join(Launcher.java:465)

at org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)

at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)

at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)


On Monday, 27 November 2017 at 01:21:50 UTC+5:30 [hidden email] wrote:

Oleg Nenashev <[hidden email]>于2017年11月26日 周日上午8:55写道:
Hi,

Docker CLI tool needs to be installed on the machine and available in PATH if you do not specify a Docker tool installation to be used.
See the withTool() documentation if you need to specify a tool path: https://github.com/jenkinsci/docker-workflow-plugin/blob/f32bca9148471ff7381f5404a747b0151305996e/src/main/resources/org/jenkinsci/plugins/docker/workflow/DockerDSL/help.jelly#L31-L37

Thanks, but you can see from the log that Docker pull already succeeded so curious why Docker inspect fails 

Best regards,
Oleg Nenashev


пятница, 24 ноября 2017 г., 11:27:02 UTC+3 пользователь Lynn Lin написал:
hi

I am following this guide to have a run jenkins pipeline in my mac  https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/O-_7JBEncV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9ece03-b187-42c0-9670-4fa1d683942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1b2a3994-ad69-47e2-b885-2a24226af8een%40googlegroups.com.
Reply | Threaded
Open this post in threaded view
|

Re: run jenkins pipeline fails "docker": error=2, No such file or directory

Mark Waite-2
The "Installing Jenkins" page for Docker also provides instructions that will allow a user to run some Docker commands from inside a customer Docker image that they create based on the official Jenkins images.

I agree with Ivan that running the Docker command line interface on the Jenkins controller should not be done in production.  Jobs should run on agents, not on the Jenkins controller.  I think you should use agents that are able to run the Docker images and use separate agents to create Docker images.

On Thu, Jan 28, 2021 at 9:24 AM Ivan Fernandez Calvo <[hidden email]> wrote:
If you are running Jenkins ins a Docker container with the official Docker container, the docker CLI command is not installed and that's your error, you need the docker CLI installed to access a Docker Host. One trick can be to mount the binary of the Docker Host where you are running that Jenkins and the Docker socket, but this configuration is for local testing never for a production environment. Something like this

docker run -it -v $(command -v docker):/usr/bin/docker -v /var/run/docker.sock:/var/run/docker.sock jenkins:lts


El jueves, 28 de enero de 2021 a las 11:59:06 UTC+1, [hidden email] escribió:
Hi,
I have Jenkins running as docker container and in my Jenkins File , in initialize stage i have following which is working also , i have installed docker from Docker hub latest. Not sure where is the problem . Pipeline is failing with the following.

ava.io.IOException: error=2, No such file or directory

at java.lang.UNIXProcess.forkAndExec(Native Method)

at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)

at java.lang.ProcessImpl.start(ProcessImpl.java:134)

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)

Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory

at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)

at hudson.Proc$LocalProc.<init>(Proc.java:250)

at hudson.Proc$LocalProc.<init>(Proc.java:219)

at hudson.Launcher$LocalLauncher.launch(Launcher.java:936)

at hudson.Launcher$ProcStarter.start(Launcher.java:454)

at hudson.Launcher$ProcStarter.join(Launcher.java:465)

at org.jenkinsci.plugins.docker.commons.impl.RegistryKeyMaterialFactory.materialize(RegistryKeyMaterialFactory.java:101)

at org.jenkinsci.plugins.docker.workflow.AbstractEndpointStepExecution2.doStart(AbstractEndpointStepExecution2.java:53)

at org.jenkinsci.plugins.workflow.steps.GeneralNonBlockingStepExecution.lambda$run$0(GeneralNonBlockingStepExecution.java:77)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)

at java.util.concurrent.FutureTask.run(FutureTask.java:266)

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)

at java.lang.Thread.run(Thread.java:748)


On Monday, 27 November 2017 at 01:21:50 UTC+5:30 [hidden email] wrote:

Oleg Nenashev <[hidden email]>于2017年11月26日 周日上午8:55写道:
Hi,

Docker CLI tool needs to be installed on the machine and available in PATH if you do not specify a Docker tool installation to be used.
See the withTool() documentation if you need to specify a tool path: https://github.com/jenkinsci/docker-workflow-plugin/blob/f32bca9148471ff7381f5404a747b0151305996e/src/main/resources/org/jenkinsci/plugins/docker/workflow/DockerDSL/help.jelly#L31-L37

Thanks, but you can see from the log that Docker pull already succeeded so curious why Docker inspect fails 

Best regards,
Oleg Nenashev


пятница, 24 ноября 2017 г., 11:27:02 UTC+3 пользователь Lynn Lin написал:
hi

I am following this guide to have a run jenkins pipeline in my mac  https://jenkins.io/doc/pipeline/tour/agents/ 

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}




and it reports below error
[pipeline] Running shell script
+ docker pull node:7-alpine
7-alpine: Pulling from library/node
Digest: sha256:4954ce53247180e207772f936223b11d52a7e4ee712dfe73fe2a75e39f785067
Status: Image is up to date for node:7-alpine
[Pipeline] }
[Pipeline] // stage
[Pipeline] sh
[pipeline] Running shell script
+ docker inspect -f . node:7-alpine
.
[Pipeline] withDockerContainer
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMetho
at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
Caused: java.io.IOException: Cannot run program "docker": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at hudson.Proc$LocalProc.<init>(Proc.java:249)
	at hudson.Proc$LocalProc.<init>(Proc.java:218)
	at hudson.Launcher$LocalLauncher.launch(Launcher.java:930)
	at hudson.Launcher$ProcStarter.start(Launcher.java:450)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:279)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:260)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.launch(DockerClient.java:257)
	at org.jenkinsci.plugins.docker.workflow.client.DockerClient.version(DockerClient.java:229)
	at org.jenkinsci.plugins.docker.workflow.WithContainerStep$Execution.start(WithContainerStep.java:141)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeStep(DSL.java:224)
	at org.jenkinsci.plugins.workflow.cps.DSL.invokeMethod(DSL.java:150)
	at org.jenkinsci.plugins.workflow.cps.CpsScript.invokeMethod(CpsScript.java:108)
	at org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:48)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at com.cloudbees.groovy.cps.sandbox.DefaultInvoker.methodCall(DefaultInvoker.java:19)
	at org.jenkinsci.plugins.docker.workflow.Docker$Image.inside(jar:file:/Users/linxin/.jenkins/plugins/docker-workflow/WEB-INF/lib/docker-workflow.jar!/org/jenkinsci/plugins/docker/workflow/Docker.groovy:1

--
You received this message because you are subscribed to a topic in the Google Groups "Jenkins Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jenkinsci-users/O-_7JBEncV8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1e9ece03-b187-42c0-9670-4fa1d683942a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/1b2a3994-ad69-47e2-b885-2a24226af8een%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHqJ%3Di4zXuYgi0vy4M4PcP%2BeQXdoo2KHg5hHp0yhTQMdg%40mail.gmail.com.