没有空间问题詹金斯 - 在码头工人

时间:2015-02-05 10:09:28

标签: jenkins docker

我在Docker中运行Jenkins。 我收到以下空格问题。

gzip: /tmp/sbt_a74fec8a/xoquick-1.0.tar.gz: No space left on device
java.lang.RuntimeException: Error gziping /tmp/sbt_a74fec8a/xoquick-1.0.tar. Exit code: 1
    at scala.sys.package$.error(package.scala:27)
    at com.typesafe.sbt.packager.universal.Archives$.gzip(Archives.scala:93)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$9.apply(Archives.scala:111)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$9.apply(Archives.scala:111)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:136)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$makeTarball$1.apply(Archives.scala:118)
    at sbt.IO$.withTemporaryDirectory(IO.scala:285)
    at com.typesafe.sbt.packager.universal.Archives$.makeTarball(Archives.scala:118)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
    at com.typesafe.sbt.packager.universal.Archives$$anonfun$10.apply(Archives.scala:111)
    at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:35)
    at scala.Function3$$anonfun$tupled$1.apply(Function3.scala:34)
    at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
    at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
    at sbt.std.Transform$$anon$4.work(System.scala:64)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
    at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
    at sbt.Execute.work(Execute.scala:244)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
    at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
    at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:745)
[error] (universal:packageZipTarball) Error gziping /tmp/sbt_a74fec8a/xoquick-1.0.tar. Exit code: 1
[error] Total time: 7 s, completed Feb 5, 2015 9:41:58 AM
Build step 'Build using sbt' changed build result to FAILURE
Build step 'Build using sbt' marked build as failure
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE

在泊坞窗中,我导航到/tmp文件夹

cd /tmp/

然后

df -h .

Filesystem            Size  Used Avail Use% Mounted on

/dev/mapper/docker-253:2-18350588-5a4c880a0e55c5b8a78ca16e7ef7fbedb7559cf07b3e249f81b88809901cca72
                  9.9G  9.1G  316M  97% /

我有足够的位置留在里面。为什么这份工作不起作用?

我已查看此http://www.ivankuznetsov.com/2010/02/no-space-left-on-device-running-out-of-inodes.html

也没有inode的问题。有足够的inode可用。有人可以告诉我这是什么问题吗?

1 个答案:

答案 0 :(得分:1)

Jenkins作业通常可以消耗大约300米的空间,包括所有构建文物,无论您上传到Docker容器,版本控制结帐的大小等。

将此添加到root的crontab以定期清理旧容器。输入sudo crontab -e进行修改:

SHELL=/bin/bash
@daily  (echo "Cleaning Docker images at $(date):"; docker rm $(docker ps -a -q); docker rmi $(docker images | grep '<none>' | tr -s ' ' | cut -d ' ' -f 3)) &>> /var/log/dockerClean.log

(如果您愿意SHELL,可以替换为2>&1 > /var/log/dockerClean.log添加sh行,或者如果您的系统默认bash则省略它并且不做任何更改< / p>