Jenkins代理由于Docker容器挂起并超时

时间:2019-10-24 20:18:27

标签: docker jenkins jenkins-pipeline jenkins-plugins

我有以下管道摘要。 码头工人镜像从私人回购被拉出没有问题。 用户/组deploy确实存在于映像中。 我可以成功执行docker run --rm -it <image> sh,因此Shell在映像中可用。 詹金斯版本:2.201。

pipeline {

    agent none

    environment {
        DIRECTORY = 'some/dir'
    }

    stages {
        stage('Validate') {
            agent {
                docker {
                    label 'slave'
                    image '*****/tool:latest'
                    registryUrl '****'
                    registryCredentialsId '*******'
                    alwaysPull true
                    args '-u deploy:deploy'
                }
            }
            steps {
                dir(env.DIRECTORY) {
                    sh 'make validate'
                }
            }
        }
    }
}

这是控制台输出:

+ docker pull **************************/tool:latest
latest: Pulling from tool
9d48c3bd43c5: Already exists
b80a93986697: Pulling fs layer
fbae4980ca4e: Pulling fs layer
05205dc51351: Pulling fs layer
1078fe87d272: Pulling fs layer
1078fe87d272: Waiting
05205dc51351: Verifying Checksum
05205dc51351: Download complete
fbae4980ca4e: Verifying Checksum
fbae4980ca4e: Download complete
b80a93986697: Download complete
1078fe87d272: Verifying Checksum
1078fe87d272: Download complete
b80a93986697: Pull complete
fbae4980ca4e: Pull complete
05205dc51351: Pull complete
1078fe87d272: Pull complete
Digest: sha256:db14e9a90bd925f94752f1a85365df4437fe43673edcf55aba5f678bf69b3235
Status: Downloaded newer image for **************************/tool:latest
**************************/tool:latest
[Pipeline] isUnix
[Pipeline] sh
+ docker inspect -f . **************************/tool:latest
.
[Pipeline] withDockerContainer
Jenkins does not seem to be running inside a container
$ docker run -t -d -u 995:992 -w /var/lib/jenkins/jobs/*****/workspace@2 -v /var/lib/jenkins/jobs/******/workspace@2:/var/lib/jenkins/jobs/******/workspace@2:rw,z -v /var/lib/jenkins/jobs/*****/workspace@2@tmp:/var/lib/jenkins/jobs/*****/workspace@2@tmp:rw,z -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** -e ******** **************************/tool:latest cat
$ docker top c94b815dcf1a380c123f75d41bb1db8bf24870e5f8300a3dac4bf00a35c8e416 -eo pid,comm
[Pipeline] {
[Pipeline] dir
Running in /var/lib/jenkins/jobs/******/workspace@2/Jenkins/********/some_folder
[Pipeline] {
[Pipeline] sh
process apparently never started in /var/lib/jenkins/jobs/******/workspace@2/Jenkins/******@tmp/durable-965ee416
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] }

Jenkins从站上的Docker版本:

Client: Docker Engine - Community
 Version:           19.03.4
 API version:       1.40
 Go version:        go1.12.10
 Git commit:        9013bf583a
 Built:             Fri Oct 18 15:52:22 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.4
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.10
  Git commit:       9013bf583a
  Built:            Fri Oct 18 15:50:54 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683

任何想法可能是根本原因吗?

0 个答案:

没有答案