Jenkins Windows docker无法运行映像,工作目录无效,它必须是绝对路径 [英] Jenkins windows docker fails to run image, working directory is invalid, it needs to be an absolute path

查看:617
本文介绍了Jenkins Windows docker无法运行映像,工作目录无效,它必须是绝对路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 10计算机上安装了Jenkins,并且正在尝试运行基本的node.js管道示例。当詹金斯尝试运行Jenkinsfile中列出的映像时,出现此错误:

I have an installation of Jenkins on my windows 10 machine and I'm trying to run the basic node.js pipeline example. When Jenkins tried to run the image I listed in the Jenkinsfile, I get this error:

Failed to run image 'node:7-alpine'. Error: docker: Error response from daemon: the working directory 'C:\Users\Joel\.jenkins\workspace\symview-3_master' is invalid, it needs to be an absolute path.

See 'docker run --help'.

这是我正在使用的Jenkinsfile:

This is the Jenkinsfile I am using:

pipeline {
     agent {
        docker { image 'node:7-alpine' }
    }

    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}

如何解决Windows上的绝对路径问题?

How can I fix the absolute path issue on windows?

推荐答案

尝试如下替换工作目录路径(用斜杠转义每个斜杠) C:\\Users\\Joel\\.jenkins \\workspace\\symview-3_master

Try replacing the working directory path as below (escape each slash with ) C:\\Users\\Joel\\.jenkins\\workspace\\symview-3_master

这篇关于Jenkins Windows docker无法运行映像,工作目录无效,它必须是绝对路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆