我们正在使用jenkins / blueocean docker与maven构建rpm。我们目前在构建rpm时遇到此错误。
Building target platforms: noarch-unknown-linux
[INFO] Building for target noarch-unknown-linux
[INFO]
[INFO]
[INFO] RPM build errors:
[INFO] error: Failed to resolve symbol ima_hooks: Symbol not found:
nspr_use_zone_allocator
[INFO] error: cannot open Packages database in /var/lib/rpm
[INFO] error: error creating temporary file /var/tmp/rpm-tmp.XXXXXX:
Permission denied
[INFO] error: Unable to open temp file: Permission denied
[INFO] Failed to resolve symbol ima_hooks: Symbol not found:
nspr_use_zone_allocator
[INFO] cannot open Packages database in /var/lib/rpm
[INFO] error creating temporary file /var/tmp/rpm-tmp.XXXXXX: Permission
denied
[INFO] Unable to open temp file: Permission denied
[INFO] ---------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ---------------------------------------------------------------------
[INFO] Total time: 54.026 s
[INFO] Finished at: 2017-04-28T11:04:56+00:00
[INFO] Final Memory: 52M/548M
[INFO] ---------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:rpm-maven-plugin:2.1.3:attached-rpm
(attach-rpm) on project wise-bxmas: RPM build execution returned:
'1' executing '/bin/sh -c cd '/var/jenkins_home/workspace/application/target/rpm/artifact/SPECS'
&& 'rpmbuild' '-bb' '--target' 'noarch-unknown-linux' '--buildroot'
'/var/jenkins_home/workspace/application/target/rpm/artifact/buildroot'
'--define' '_topdir /var/jenkins_home/workspace/artifact/target/rpm/artifact'
'artifact.spec'' -> [Help 1]
我们用来构建的工具:
我查看了Google,但未发现任何相关问题和/或解决方案。
有谁知道如何解决这个问题?
答案 0 :(得分:0)
解决了它。这个问题的实际原因是:
Unable to open temp file: Permission denied
我通过添加:
来解决RUN chmod -R 777 /var/tmp/
到Dockerfile。构建用户'jenkins'此时可以访问该目录。然后正确构建RPM。