【发布时间】:2023-02-05 04:21:45
【问题描述】:
目前我的 dockerfile 只是:
FROM ubuntu:latest
RUN apt-get update
RUN apt install software-properties-common -y
但是,在构建 dockerfile 并运行步骤 apt install software-properties-common -y 时,消息中出现以下错误:
#0 41.07 Setting up python3.10-minimal (3.10.6-1~22.04.2) ...
#0 41.16 [Errno 13] Permission denied: '/usr/lib/python3.10/__pycache__/__future__.cpython-310.pyc.139723958934016'dpkg: error processing package python3.10-minimal (--configure):
#0 41.16 installed python3.10-minimal package post-installation script subprocess returned error exit status 1
#0 41.17 Errors were encountered while processing:
#0 41.17 python3.10-minimal
#0 41.18 E: Sub-process /usr/bin/dpkg returned an error code (1)
------
failed to solve: executor failed running [/bin/sh -c apt install software-properties-common -y]: exit code: 100
想知道你们是否可以帮我解决这个错误以完成 dockerfile 的构建?
【问题讨论】:
-
将 sudo 添加到您的命令
-
然后先安装sudo
-
该进程以 root 身份运行,因此 sudo 除了增加混乱之外什么都不做。那不是解决方案。
-
当我构建您的原始 Dockerfile(无 sudo)时,它可以工作并且我没有收到您遇到的错误。通过
docker pull ubuntu:latest确保您在本地拥有最新的 ubuntu 映像。并确保您没有用完磁盘空间。 -
@HansKilian 谢谢,是的,原来是
snap版本的 docker 导致了这个问题
标签: python linux docker ubuntu apt