Newer version of Docker gives permission errors during build

怎甘沉沦 提交于 2020-01-06 07:53:28

问题


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.

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

The failure I'm seeing is:

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.

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

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.

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


回答1:


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.

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


来源:https://stackoverflow.com/questions/55230329/newer-version-of-docker-gives-permission-errors-during-build

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!