Issue
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?
Solution
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"
}
}
}
Answered By - jcunhafonte