在ubuntu 16.04 docker映像中安装python3

在ubuntu 16.04 docker映像中安装python3,python,python-3.x,docker,ubuntu,dockerfile,Python,Python 3.x,Docker,Ubuntu,Dockerfile,我试图在ubuntu 16.04 docker映像中安装python 3.6。它以前工作得很好。但今天它开始显示这个错误 Step 8/14 : RUN add-apt-repository ppa:jonathonf/python-3.6 ---> Running in a27c7c55afef This PPA has been removed from public access as part of a protest against the abuse of open-sou

我试图在ubuntu 16.04 docker映像中安装python 3.6。它以前工作得很好。但今天它开始显示这个错误

Step 8/14 : RUN add-apt-repository ppa:jonathonf/python-3.6
 ---> Running in a27c7c55afef
 This PPA has been removed from public access as part of a protest against the abuse of open-source projects by large companies. For more detail visit the main page here: https://launchpad.net/~jonathonf

If you are a company and you would like this PPA to continue then let me know your preferred route for contributions and I will arrange something.
Ign:8 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main all Packages
Err:7 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main amd64 Packages
  404  Not Found
Ign:8 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial/main all Packages
Reading package lists...
W: The repository 'http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial Release' does not have a Release file.
E: Failed to fetch http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found
E: Some index files failed to download. They have been ignored, or old ones used instead.
我对此不确定。我不明白这个问题。我怎样才能解决这个问题

我的docker代码如下:

FROM ubuntu:16.04

COPY requirements.txt /


RUN apt-get update
RUN apt-get install -y software-properties-common vim
RUN add-apt-repository ppa:jonathonf/python-3.6
RUN apt-get update

RUN apt-get install -y build-essential python3.6 python3.6-dev python3-pip python3.6-venv python-dev libssl-dev swig
RUN apt-get install -y git

# update pip
RUN python3.6 -m pip install pip --upgrade
RUN python3.6 -m pip install wheel

RUN pip install -r requirements.txt
有人面临同样的问题吗


提前感谢。

您收到的错误似乎非常明显:

作为抗议大公司滥用开源项目的一部分,该PPA已从公众访问中删除。有关更多详细信息,请访问此处的主页:


作者已删除您尝试使用的PPA。您需要找到另一个PPA,或者自己从源代码安装Python,或者使用不同的基本映像。例如,如果您需要python 3.6(或者只需
python:3.7
python:3.8
,具体取决于您的需要),您可以使用标准的
python:3.6
基本映像。

感谢@larsks对问题的快速解释。您能建议我如何获得有效的Python PPA吗。我发现了一个是“ppa:deadsnakes/ppa”。但我对他们的免责声明表示怀疑。在出现安全问题或其他问题时,无法保证及时更新。如果您想在安全或其他关键环境(例如,在生产服务器上)中使用这些协议,则风险自负。我无法提供有关可用PPA的任何信息。我通常只使用一个较新版本的Ubuntu,其中包含必要的Python本机版本。