【发布时间】:2018-07-18 00:12:10
【问题描述】:
我想扩展 docker (postgresql-96-centos7) 来添加 java。 我尝试构建下一个 dockerfile:
FROM centos/postgresql-96-centos7
RUN yum update -y && \
yum install -y wget && \
yum install -y java-1.8.0-openjdk && \
yum clean all
# Set environment variables.
ENV HOME /root
# Define working directory.
WORKDIR /root
# Define default command.
CMD ["bash"]
使用命令:
docker image build -t centos_pgs_java .
但是有一个错误:
Step 3/6 : RUN yum update -y && yum install -y wget && yum install -y java-1.8.0-openjdk && yum clean all
---> Running in d93a94a61a11
Loaded plugins: fastestmirror, ovl
ovl: Error while doing RPMdb copy-up:
[Errno 13] Permission denied: '/var/lib/rpm/Group'
You need to be root to perform this command.
The command '/bin/sh -c yum update -y && yum install -y wget && yum install -y java-1.8.0-openjdk && yum clean all' returned a non-zero code: 1
如何用root权限重写dockerfile中的RUN命令?
【问题讨论】:
-
...为什么在数据库容器中需要 JVM?