【发布时间】:2021-03-07 10:37:13
【问题描述】:
我正在尝试从此图像创建 Dockerfile:https://hub.docker.com/r/centos/python-27-centos7
我的 Dockerfile:
FROM centos/python-27-centos7:latest
RUN yum install rpm-build -y
WORKDIR /usr/src/app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
CMD ["bash"]
但我得到了下一个错误:
=> ERROR [2/9] RUN yum install rpm-build -y 0.6s
------
> [2/9] RUN yum install rpm-build -y:
#5 0.480 Loaded plugins: fastestmirror, ovl
#5 0.485 ovl: Error while doing RPMdb copy-up:
#5 0.485 [Errno 13] Permission denied: '/var/lib/rpm/Dirnames'
#5 0.579 You need to be root to perform this command.
------
我尝试添加 sudo 但仍然无法正常工作。 这里有什么问题?
【问题讨论】:
-
@SiHa 我不确定,因为然后
yum install安装到另一个目录...也许我需要通过 root 安装,然后替换一些二进制文件或添加到 PATH.. -
和
RUN chmod 0644?
标签: docker dockerfile centos7 rpm yum