安装Python 3.6.5但在Docker中安装了Python 3.6.6

Rex*_*Low 3 python ubuntu docker

我尝试安装特定版本的Python(3.6.5),它在几周前可以运行,而今天,当我重建映像时,它给出了3.6.6。

有人也有这个问题吗?

Ubuntu(主机)版本: Ubuntu 18.04.1 LTS

Docker版本: 18.06.1-ce, build e68fc7a

这是我的Dockerfile

FROM ubuntu:18.04

# ENV Variables
ENV DEBIAN_FRONTEND=noninteractive
ENV PYTHON_VERSION="3.6.5"

# Install core packages
RUN apt-get update
RUN apt-get install -y build-essential checkinstall software-properties-common llvm cmake wget git nano nasm yasm zip unzip pkg-config \
    libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev mysql-client default-libmysqlclient-dev

# Install Python 3.6.5
RUN wget https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tar.xz \
    && tar xvf Python-${PYTHON_VERSION}.tar.xz \
    && rm Python-${PYTHON_VERSION}.tar.xz \
    && cd Python-${PYTHON_VERSION} \
    && ./configure \
    && make altinstall \
    && cd / \
    && rm -rf Python-${PYTHON_VERSION}
Run Code Online (Sandbox Code Playgroud)

Jak*_*jny 5

您的apt-get命令以静默方式安装Python 3.6.6,因为其中一个程序依赖于python,请参阅日志:

The following NEW packages will be installed:                                                          
...
pkg-config powermgmt-base publicsuffix python-apt-common python3 python3-apt
python3-dbus python3-gi python3-minimal python3-software-properties
python3.6 python3.6-minimal readline-common shared-mime-info
...
Run Code Online (Sandbox Code Playgroud)

Ubuntu软件包中可能存在从Python 3.6.5到3.6.6的更新,这是有可能的,因为在特定的Ubuntu版本中允许补丁版本更新(您可以在运行后在主机上进行检查,apt-get update并且apt-get upgrade因为我可以在Ubuntu 18.04 Python上看到升级)