Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Install Python 3.6.5 but got Python 3.6.6 in Docker

I tried to install a specific version of Python (3.6.5), it works a few weeks back and today when I rebuild the image, it gives 3.6.6.

Anyone having this problem as well?

Ubuntu (host) version: Ubuntu 18.04.1 LTS

Docker version: 18.06.1-ce, build e68fc7a

Here's my 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}
like image 493
Rex Low Avatar asked Oct 23 '25 06:10

Rex Low


1 Answers

Your apt-get command silently install Python 3.6.6 because one of those programs has dependency on python, see the log:

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
...

There was probably update in Ubuntu packages from Python 3.6.5 to 3.6.6 as it's possible because patch version update is allowed within particular Ubuntu version ( you can check that on your host machine after running apt-get update and apt-get upgrade because I can see on my Ubuntu 18.04 Python upgrade)

like image 119
Jakub Bujny Avatar answered Oct 24 '25 22:10

Jakub Bujny



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!