3

I'm trying to setup the software tests inside Jenkins for a legacy project at work.

In order to run those tests i need to setup a Docker container based on an old ruby version having several packages installed.

(excerpt from the 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'''

However i'm getting the following error during the 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

this is weird especially since running this while building a container works flawless.

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

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

Anyone has an idea on what might be the problem?

Sys Info:

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

0 Answers0