Note
Some Python versions may cause errors related to missing specific archives. This issue can be resolved with a minor change in tgz archive.
A Dockerfile that attempts to install the Python 3.x distribution from all available versions listed on https://www.python.org/ftp/python/.
It downloads the source code from the website and installs it locally using the make
command.
To see all available versions, run:
python python_versions.py
To set the desired Python version, specify it in the Dockerfile (the default version is 3.12.0
):
ARG PYTHON_VERSION='<python-version>'
or it can be passed while building the image
Build docker image:
docker build -t py-dev .
Run container in interactive mode:
docker run -it --rm -v ${PWD}:/usr/src/app py-dev
Written in Powershell