较新版本的Docker在构建过程中出现权限错误 [英] Newer version of Docker gives permission errors during build

查看:87
本文介绍了较新版本的Docker在构建过程中出现权限错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建了一个Dockerfile在32位Ubuntu映像上安装IBM Rational Rhapsody,该映像可以在Windows 7上使用Docker 18.03.0-ce正确构建,但是在Linux Mint 19 VM上无法在Docker 18.09.2上构建(Ubuntu Bionic仓库) ). IBM的基于Java的安装程序引发了权限问题,而Docker变更日志并未显示任何明显的原因.

I've created a Dockerfile to install IBM Rational Rhapsody on a 32bit Ubuntu image, which builds correctly with Docker 18.03.0-ce on Windows 7 but fails with Docker 18.09.2 on a Linux Mint 19 VM (Ubuntu Bionic repos). IBM's Java-based installer throws a permissions issue, and the Docker changelogs didn't show any obvious reasons for this.

直到失败命令为止的Dockerfile如下:

The Dockerfile up to the failing command is as follows:

FROM i386/ubuntu:xenial-20181005 AS installation

ARG DEBIAN_FRONTEND=noninteractive
RUN apt-get update && apt-get install -y --no-install-recommends unzip

COPY Rhapsody812Linux.zip .
RUN unzip -qq Rhapsody812Linux.zip -d Rhapsody812Linux

RUN cd Rhapsody812Linux/disk1/im/installer.linux.gtk.x86 \
    && ./installc input install-rhapsody.xml -acceptLicense

我看到的失败是:

org.eclipse.core.runtime.CoreException: Failed to create artifact table of contents at '/var/ibm/InstallationManager/installRegistry/metadata'.
  ...IBM's library stack trace truncated by me...
Caused by: java.io.IOException: Permission denied
  at sun.nio.ch.FileChannelImpl$1.release(FileChannelImpl.java:115)
  at sun.nio.ch.FileChannelImpl$SimpleFileLockTable.removeAll(FileChannelImpl.java:1024)
  at sun.nio.ch.FileChannelImpl.implCloseChannel(FileChannelImpl.java:112)
  at java.nio.channels.spi.AbstractInterruptibleChannel.close(AbstractInterruptibleChannel.java:108)
  ...IBM's library stack trace truncated by me...
ERROR: Error restoring Installation Manager state.
  ERROR:   Failed to create InstallRegistry metadata repository: /var/ibm/InstallationManager/installRegistry/metadata.

我发现了一个论坛帖子,指出如果/tmp无法访问,这可能会发生,这似乎是这样的:

I found a forum post stating this can happen if /tmp isn't accessible, which it seems to be:

drwxr-xr-x 2 root root 4096 Mar 18 20:35 /tmp

我以交互方式运行Ubuntu Xenial映像以查看可以找到的内容,并且安装程序会创建/var/ibm/InstallationManager/installRegistry/metadata,因此我不确定权限问题来自何处.

I ran an Ubuntu Xenial image interactively to see what I could find out, and the installer does create /var/ibm/InstallationManager/installRegistry/metadata so I'm not sure where the permission issue is coming from.

这些Docker版本之间可能有什么不同,如何解决新版本中的构建失败?

What could be different between these Docker versions, and how can I resolve this build failure in the newer version?

推荐答案

连续运行安装程序多次后,我收到"CRIMC1086E错误"并发现了

After running the installer multiple times consecutively, I got a "CRIMC1086E ERROR" and found an IBM Knowledge Center entry mentioning this code. It suggests disabling the IBM Installation Manager's repository locking, which resolved the issue for me.

要禁用存储库锁定,请将cic.repo.locking=false添加到config.ini.就我而言,我在Dockerfile中添加了以下内容:

To disable the repository lock, add cic.repo.locking=false to config.ini. In my case, I made the following addition to my Dockerfile:

# Disable repo lock to avoid potential permissions issue when lock is released
# Experienced with Docker 18.09.2 on a Linux Mint 19 VM
RUN cd Rhapsody812Linux/disk1/im/installer.linux.gtk.x86/configuration \
    && echo 'cic.repo.locking=false' >> config.ini

这篇关于较新版本的Docker在构建过程中出现权限错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆