Я использую Jenkins 2.190.1, установленный на Linux Ubuntu LTD 18.04. Я только что протестировал пример кода в Руководстве по Jenkins: https://jenkins.io/doc/pipeline/tour/hello-world/
Конкретно мой Jenkinsfile выглядит следующим образом:
pipeline {
agent { docker { image 'maven:3.3.3' } }
stages {
stage('build') {
steps {
sh 'mvn --version'
}
}
}
}
Это вывод, который я получаю в журнале консоли jenkins:
$ docker run -t -d -u 122:127 -w /var/lib/jenkins/workspace/Tutorial -v /var/lib/jenkins/workspace/Tutorial:/var/lib/jenkins/workspace/Tutorial:rw,z -v /var/lib/jenkins/workspace/Tutorial@tmp:/var/lib/jenkins/workspace/Tutorial@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 ******** maven:3-alpine cat
$ docker top f7771c51c24b1a4d283f327c2ac26959f649f253778f53d65caa94edb0f35cfc -eo pid,comm
[Pipeline] {
[Pipeline] sh
process apparently never started in /var/lib/jenkins/workspace/Tutorial@tmp/durable-74c26f6c
(running Jenkins temporarily with -Dorg.jenkinsci.plugins.durabletask.BourneShellScript.LAUNCH_DIAGNOSTICS=true might make the problem clearer)
[Pipeline] }
$ docker stop --time=1 f7771c51c24b1a4d283f327c2ac26959f649f253778f53d65caa94edb0f35cfc
$ docker rm -f f7771c51c24b1a4d283f327c2ac26959f649f253778f53d65caa94edb0f35cfc
[Pipeline] // withDockerContainer
[Pipeline] }
[Pipeline] // withEnv
[Pipeline] }
[Pipeline] // node
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
ERROR: script returned exit code -2
Finished: FAILURE