Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.8k views
in Technique[技术] by (71.8m points)

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

I have jenkins running as docker container and i am installing docker from docker.com latest in global tool configuration.

in Jenkinsfile while initializing its working fine.

stage('Initialize') {
            steps {
                script {
                    def dockerHome = tool 'myDocker'
                     env.PATH = "${dockerHome}/bin:${mavenHome}/bin:${env.PATH}"

But in pipeline , its failing with below error.

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)

Anything i am missing?

question from:https://stackoverflow.com/questions/65935953/caused-java-io-ioexception-cannot-run-program-docker-error-2-no-such-file

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...