詹金斯奴隶失败

时间:2018-07-26 04:18:43

标签: docker jenkins kubernetes jenkins-slave

我正在kubernetes中运行jenkins,并试图创建一个自定义容器来运行从属服务器。我配置了jenkins来拉我的docker容器,并且似乎按预期工作(将其拉出并在K8s中启动)。

不幸的是,我在运行管道时遇到“访问被拒绝”异常。不确定为什么会出现此错误:

  

也:hudson.remoting.Channel $ CallSiteStackTrace:远程调用   JNLP4连接从10.40.0.25/10.40.0.25:54108在   hudson.remoting.Channel.attachCallSiteStackTrace(Channel.java:1741)         在   hudson.remoting.UserRequest $ ExceptionResponse.retrieve(UserRequest.java:357)         在hudson.remoting.Channel.call(Channel.java:955)处   hudson.FilePath.act(FilePath.java:1036)在   hudson.FilePath.act(FilePath.java:1025)在   hudson.FilePath.mkdirs(FilePath.java:1208)位于   hudson.plugins.git.GitSCM.createClient(GitSCM.java:810)在   hudson.plugins.git.GitSCM.checkout(GitSCM.java:1180)在   org.jenkinsci.plugins.workflow.steps.scm.SCMStep.checkout(SCMStep.java:113)         在   org.jenkinsci.plugins.workflow.steps.scm.SCMStep $ StepExecutionImpl.run(SCMStep.java:85)         在   org.jenkinsci.plugins.workflow.steps.scm.SCMStep $ StepExecutionImpl.run(SCMStep.java:75)         在   org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution $ 1 $ 1.call(AbstractSynchronousNonBlockingStepExecution.java:47)         在hudson.security.ACL.impersonate(ACL.java:290)处   org.jenkinsci.plugins.workflow.steps.AbstractSynchronousNonBlockingStepExecution $ 1.run(AbstractSynchronousNonBlockingStepExecution.java:44)         在   java.util.concurrent.Executors $ RunnableAdapter.call(Executors.java:511)         在java.util.concurrent.FutureTask.run(FutureTask.java:266)在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)         在   java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)   java.nio.file.AccessDeniedException:/ root / workspace位于   sun.nio.fs.UnixException.translateToIOException(UnixException.java:84)     在   sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)     在   sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)     在   sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:308)     在java.nio.file.Files.createDirectories(Files.java:746)在   hudson.FilePath.mkdirs(FilePath.java:3098)位于   hudson.FilePath.access $ 900(FilePath.java:209)在   hudson.FilePath $ Mkdirs.invoke(FilePath.java:1216)在   hudson.FilePath $ Mkdirs.invoke(FilePath.java:1212)在   hudson.FilePath $ FileCallableWrapper.call(FilePath.java:2913)在   hudson.remoting.UserRequest.perform(UserRequest.java:212)在   hudson.remoting.UserRequest.perform(UserRequest.java:54)在   hudson.remoting.Request $ 2.run(Request.java:369)在   hudson.remoting.InterceptingExecutorService $ 1.call(InterceptingExecutorService.java:72)     在java.util.concurrent.FutureTask.run(FutureTask.java:266)在   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)     在   java.util.concurrent.ThreadPoolExecutor $ Worker.run(ThreadPoolExecutor.java:624)     在hudson.remoting.Engine $ 1.lambda $ newThread $ 0(Engine.java:93)在   java.lang.Thread.run(Thread.java:748)完成:失败

DockerFile-我用来创建从属容器的那个

FROM gcr.io/cloud-solutions-images/jenkins-k8s-slave
USER root
### INSTALL PRE REQUISITES
RUN apt-get update && apt-get install -y golang docker

Jenkinsfile-超级简单的管道

pipeline {
    agent any
    stages {
        stage('Download Code') {
            steps {
                echo 'Checking Out SCM..'
                checkout scm
            }
        }
        stage('Build container') {
            steps {
                sh 'docker build -t golangwebserver:minimal --build-arg KEY=$GITHUB_OATH_KEY -f DockerFiles/Dockerfile .'
            }
        }
    }
}

任何帮助将不胜感激。

0 个答案:

没有答案