来自 ubuntu 的 Dockerfile:22.04 apt 无法找到包 python3

问题描述 投票:0回答:1

当我

docker build
这个时:

FROM ubuntu:22.04
RUN apt-get install -y python3

我明白了

Step 1/2 : FROM ubuntu:22.04
 ---> c6b84b685f35
Step 2/2 : RUN apt-get install -y python3
 ---> Running in d1f4eff8d024
Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package python3

怎么了?

python docker ubuntu apt
1个回答
0
投票

首先运行

apt-get upgrade
然后就可以安装
python
包了。

这是一个例子:

FROM ubuntu:22.04
RUN apt-get upgrade
RUN apt-get install -y python3
© www.soinside.com 2019 - 2024. All rights reserved.