简体   繁体   English

apt-get install -y openjdk-8-jdk 失败

[英]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:在运行Jenkins 的DockerFileLinux节点上通过apt安装openjdk-8-jdk 时,我收到以下消息:

The command apt-get update && apt-get install -y openjdk-8-jdk returned a non-zero code: 100.命令apt-get update && apt-get install -y openjdk-8-jdk返回非零代码:100。

Full log:完整日志:

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

... ...

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)错误:4 http://deb.debian.org/debian stretch Release 无法打开文件 /var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch_Release - 打开(28:设备上没有剩余空间)

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)错误:5 http://deb.debian.org/debian stretch-updates Release 无法打开文件 /var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch-updates_Release - 打开(28:设备上没有剩余空间)

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...错误:6 http://security.debian.org/debian-securitystretch/updates Release 无法打开文件 /var/lib/apt/lists/partial/security.debian.org_debian-security_dists_stretch_updates_Release - 打开(28:没有剩余空间在设备上)阅读包列表...

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.使用docker system prune手动清除设备上的空间并不是完美的解决方案,因为在某些构建之后,您必须不断清理它。

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

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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