简体   繁体   中英

Apt-get install -y openjdk-8-jdk fails

When installing openjdk-8-jdk through apt on DockerFile and Linux node running with Jenkins I get the following message:

The command apt-get update && apt-get install -y openjdk-8-jdk returned a non-zero code: 100.

Full log:

Step 5/7 : RUN apt-get update && apt-get install -y openjdk-8-jdk ---> Running in ...

...

Err:4 http://deb.debian.org/debian stretch Release Could not open file /var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch_Release - open (28: No space left on device)

Err:5 http://deb.debian.org/debian stretch-updates Release Could not open file /var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch-updates_Release - open (28: No space left on device)

Err:6 http://security.debian.org/debian-security stretch/updates Release Could not open file /var/lib/apt/lists/partial/security.debian.org_debian-security_dists_stretch_updates_Release - open (28: No space left on device) Reading package lists...

What can I do to solve this issue?

You don't have space left on device. Clear space and try again

The best solution I found to this problem was to clear the space after every build. Clearing the space on the device manually with docker system prune wasn't the perfect solution since after some builds you had to keep cleaning it.

pipeline {
    stages {
        stage ('start') {
            ...
        }
     }

     post {
        always {
            sh "docker system prune -f"
        }
     }
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM