小编dun*_*mus的帖子

Jenkins Pipeline-无法连接到Docker守护程序

我正在按照本教程在docker中使用jenkins构建一个hello-world Maven Java应用程序:https ://jenkins.io/doc/tutorials/building-a-java-app-with-maven/#fork-and-clone- github上的sample-repository

这是我的应用程序(只是本教程的分支):simple-java-maven-app

与我在管道选项(存储库URL)中使用远程存储库(Github)而不是本地存储库(或主机存储库)相比,存在一个小的差异。我推送了Jenkinsfile进行回购,然后使用Pipeline构建了hello-world应用。

// Jenkinsfile for Pipeline
pipeline {
    agent {
        docker {
            image 'maven:3-alpine' 
            args '-v /root/.m2:/root/.m2' 
        }
    }
    stages {
        stage('Build') { 
            steps {
                sh 'mvn -B -DskipTests clean package' 
            }
        }
    }
}
Run Code Online (Sandbox Code Playgroud)

我在下面收到此错误,找不到任何解决方案。我正在使用Windows 10。

docker pull maven:3-alpine
Warning: failed to get default registry endpoint from daemon (Cannot connect to the Docker daemon. Is the docker daemon running on this host?). Using system default: https://index.docker.io/v1/
Cannot connect to the …
Run Code Online (Sandbox Code Playgroud)

maven jenkins docker windows-10 jenkins-pipeline

2
推荐指数
1
解决办法
1698
查看次数

标签 统计

docker ×1

jenkins ×1

jenkins-pipeline ×1

maven ×1

windows-10 ×1