如何在 docker 中安装 python36 和 python36-dev:oraclelinux:7-slim

How to install python36 and python36-dev in docker: oraclelinux:7-slim

下面是Dockerfile。我厌倦了很多组合。它不工作。我需要使用 Oraclelinux。我计划使用 docker 进行本地开发和测试。你能帮我解决这个问题吗?

  FROM oraclelinux:7-slim

# Installing Oracle Instant client
RUN yum -y install oracle-release-el7 && \
    yum-config-manager --enable ol7_oracle_instantclient && \
    yum -y install oracle-instantclient19.3-basiclite && \
    rm -rf /var/cache/yum

# Installing Python and cs_oracle package
RUN yum install -y oracle-epel-release-el7 && \
    yum install -y python36 && \
    yum install -y python36-dev

错误:

Package python36-3.6.8-1.el7.x86_64 is obsoleted by python3-3.6.8-13.0.1.el7.x86_64 which is already installed
--> Processing Dependency: python36-libs(x86-64) = 3.6.8-1.el7 for package: python36-devel-3.6.8-1.el7.x86_64
Package python36-libs-3.6.8-1.el7.x86_64 is obsoleted by python3-libs-3.6.8-13.0.1.el7.x86_64 which is already installed
--> Finished Dependency Resolution
Error: Package: python36-devel-3.6.8-1.el7.x86_64 (ol7_developer_EPEL)
           Requires: python36 = 3.6.8-1.el7
           Installed: python3-3.6.8-13.0.1.el7.x86_64 (@ol7_latest)
               python36 = 3.6.8-13.0.1.el7
           Available: python3-3.6.8-10.0.1.el7.x86_64 (ol7_latest)
               python36 = 3.6.8-10.0.1.el7
           Available: python36-3.6.3-7.el7.x86_64 (ol7_developer_EPEL)
               python36 = 3.6.3-7.el7
           Available: python36-3.6.6-1.el7.x86_64 (ol7_developer_EPEL)
               python36 = 3.6.6-1.el7
           Available: python36-3.6.6-2.el7.x86_64 (ol7_developer_EPEL)
               python36 = 3.6.6-2.el7
           Available: python36-3.6.8-1.el7.x86_64 (ol7_developer_EPEL)
               python36 = 3.6.8-1.el7
Error: Package: python36-devel-3.6.8-1.el7.x86_64 (ol7_developer_EPEL)
           Requires: python36-libs(x86-64) = 3.6.8-1.el7
           Installed: python3-libs-3.6.8-13.0.1.el7.x86_64 (@ol7_latest)
               python36-libs(x86-64) = 3.6.8-13.0.1.el7
           Available: python3-libs-3.6.8-10.0.1.el7.x86_64 (ol7_latest)
               python36-libs(x86-64) = 3.6.8-10.0.1.el7
           Available: python36-libs-3.6.3-7.el7.x86_64 (ol7_developer_EPEL)
               python36-libs(x86-64) = 3.6.3-7.el7
           Available: python36-libs-3.6.6-1.el7.x86_64 (ol7_developer_EPEL)
               python36-libs(x86-64) = 3.6.6-1.el7
           Available: python36-libs-3.6.6-2.el7.x86_64 (ol7_developer_EPEL)
               python36-libs(x86-64) = 3.6.6-2.el7
           Available: python36-libs-3.6.8-1.el7.x86_64 (ol7_developer_EPEL)
               python36-libs(x86-64) = 3.6.8-1.el7

我看到您正在尝试安装一个版本的 python,该版本已被另一个版本的 python 淘汰。在这种情况下,您可以尝试卸载 python 的当前版本并安装您尝试安装的特定版本。

希望有用! :)

查看 oracle/docker-images/OracleLinuxDevelopers 存储库中的 Dockerfile。

有2个例子:

  • oraclelinux7-python:3.6 是 Python 3.6 在 oraclelinux:7-slim
  • 之上
  • oraclelinux7-python:3.6-oracledb 具有相同的 python 版本,但还包括 Oracle Instant Client 程序包