【问题标题】:redhat7 docker image: how to install python3redhat7 docker镜像:如何安装python3
【发布时间】:2021-06-29 11:21:37
【问题描述】:

我需要在 RH7 docker 镜像中安装 python3。不幸的是,我是 RedHat 的新手,安装那个 python 版本似乎相当复杂。我可以得到一些帮助或工作的 Docker 文件吗?

【问题讨论】:

    标签: docker python-3.6 redhat


    【解决方案1】:

    您可以相应地更新您的 Dockerfile,以使用具有所需 python 版本的基础映像:

    已安装 python3 的示例 Red Hat Enterprise Linux Server 版本 7.9 (Maipo) 映像:

    
    $ docker run -itu 0 registry.access.redhat.com/ubi7/python-36 /bin/bash
    Unable to find image 'registry.access.redhat.com/ubi7/python-36:latest' locally
    latest: Pulling from ubi7/python-36
    1323a241cc06: Pull complete                                                                                                                                                                                                                  2bd25ca12457: Pull complete                                                                                                                                                                                                                  5d011ac93e74: Pull complete                                                                                                                                                                                                                  fa92b53b7e2a: Pull complete                                                                                                                                                                                                                  06e86f96ac44: Pull complete                                                                                                                                                                                                                  Digest: sha256:e7658aeaaf6c5897b602ad5a69f8c48761b494d47f27a2251036f363c4a0450f
    Status: Downloaded newer image for registry.access.redhat.com/ubi7/python-36:latest
    (app-root)
    (app-root) python --version
    Python 3.6.9
    

    【讨论】:

    • 这个答案的大部分似乎是两个大的 PNG 文件。您能否编辑此问题以将相关信息作为文本包含在内?
    猜你喜欢
    • 1970-01-01
    • 2020-10-16
    • 2014-08-10
    • 2021-11-04
    • 1970-01-01
    • 2023-01-10
    • 2023-01-23
    • 2022-01-08
    • 1970-01-01
    相关资源
    最近更新 更多