在Docker镜像中安装Python3.10?

-2 投票
0 回答
22 浏览
提问于 2025-04-12 06:12

我正在尝试设置一个Docker镜像,里面要安装Python3.10。因为我需要在别人的基础上构建,所以不能使用常见的FROM python:3.10-xxx镜像,而是要从FROM nrel/energyplus:23.2.0开始。

所以我打算自己安装Python3.10,但到目前为止完全失败了。有没有好的例子,能告诉我在Dockerfile中怎么正确地做这件事?

当我在Dockerfile中加上这一行:

RUN apt-get update && apt-get install -y python3.10 python3-pip

时,系统会让我输入一些内容:

 => [app 2/9] RUN apt-get update && apt-get install -y python3.10 python3-pip                                          265.7s
 => => #   1. Africa        6. Asia            11. System V timezones                                                        
 => => #   2. America       7. Atlantic Ocean  12. US                                                                        
 => => #   3. Antarctica    8. Europe          13. None of the above                                                         
 => => #   4. Australia     9. Indian Ocean                                                                                  
 => => #   5. Arctic Ocean  10. Pacific Ocean                                                                                
 => => # Geographic area:  

然后构建就停下来了。这是安装Python3.10的正确方法吗?有没有办法跳过这个需要用户输入的部分?

0 个回答

暂无回答

撰写回答