如何在 alpine docker 图像中同时安装 python2.7 和 3.7

How do I get python2.7 and 3.7 both installed in an alpine docker image

我正在尝试找到一种方法,可以在轻量级高山 docker 映像中同时安装 python2.7 和 3.7。

目前我正在使用

FROM python:3.7-alpine3.9

基本映像,但也想知道如何安装 python2。

使用类似于:

RUN apk add --no-cache python2

这将安装最新版本的 Python 2 作为 python2python2.7。 Python 3.7.3 仍然可以使用 python3,或者简单地 python