Jenkins Docker Pipeline 中的“跨设备链接无效”错误消息是什么意思?

Jenkins Docker Pipeline 中的“跨设备链接无效”错误消息是什么意思?

我正在尝试在 Jenkins 内部为工作中的遗留项目设置软件测试。

为了运行这些测试,我需要基于安装了几个包的旧 ruby​​ 版本设置一个 Docker 容器。

(摘自 Jenkinsfile)

stage("Test") {
    docker.image('ruby:2.2.2').inside('-u 0:0') {
        // preparation of container
        sh 'apt-get update && apt-get -y upgrade'
        sh '''apt-get install -y nginx supervisor mariadb-client git openssh-client
            build-essential libmysqlclient-dev python libqt5webkit5-dev qt5-default qt5-qmake xvfb'''

然而,我在apt-get -y upgrade

dpkg: error processing archive /var/cache/apt/archives/libltdl7_2.4.2-1.11+b1_amd64.deb (--unpack):
 unable to make backup link of `./usr/lib/x86_64-linux-gnu/libltdl.so.7.3.0' before installing new version: Invalid cross-device link

这很奇怪,特别是在构建容器时运行这个程序可以完美地进行。

# Jenkinsfile
stage("Build Container") {
    builtImage = docker.build(projectName + ':' + scmVars.GIT_COMMIT)
    builtImage.tag(envTagName)
}

# Dockerfile
RUN apt-get update && apt-get -y upgrade

谁知道可能是什么问题?

系统信息:

Host OS: Ubuntu 18.04.2 LTS; Linux 4.15.0-51-generic
Jenkins v2.187 running inside container
Docker version 18.06.1-ce, build e68fc7a

相关内容