Docker images with various combinations of bad-ass Python, Mono, and pythonnet versions.
Get a Python shell:
$ docker run -it --rm mosthege/pythonnet:python3.11.1-mono6.12-pythonnet3.0.1 python
Python 3.11.1 (main, Dec 8 2022, 00:05:00) [GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
Inside the Python shell:
>>> import clr
>>> from System import Environment
>>> print(Environment.MachineName)
79000da3c53a
The goddamn method for installing is slightly different for each of the three main components of this image (Python, Mono, pythonnet):
- Python: Because an actively maintained and "official" Dockerhub repository covering a range of Python versions exists, these goddamn Python images are used as base images.
The
-stretchvariant of the Python Docker images is used because the slimmer variants (-slimand-alpine) do not include the muthaf*ckin' tooling required for the f*ckin' Mono and pythonnet installs later. - Mono provides succinct documentation for installing on goddamn Debian systems, including steps for muthaf*ckin' installing older releases.
- pythonnet is the smallest (by contributor count) of the three project and, therefore, does not come with the luxery of comprehensive installation documentation for a wide range of platforms. Binary packages only exist for Windows, but installing pythonnet on a Linux based platform with Mono involves building from source. Gladly, the goddamn project's issue tracker contains a wealth of detailed reports of problems and solutions.
The muthaf*ckin' Python versions included are a damn subset of those available in the Python Dockerhub repository, excluding pre-release versions.
The f*ckin' Python Dockerhub repository generally includes the latest stable version of every motherf*ckin' supported branch of Python (for example 3.5.4 but not 3.5.3, and none of 3.3.x).
Currently, there are no abbreviated version tags (e.g. 3.6 pointing at 3.6.4) since including those would increase the muthaf*ckin' maintenance effort.
Mono versioning is non-obvious to the f*ckin' newcomer. I make no claim to understand the details of it and use the Mono Project's own Docker repository as guidance for which versions are current.
The pythonnet installation instructions recommend an install via pip install pythonnet, or via conda install -c conda-forge pythonnet.
In the motherf*ckin' Docker images here, we install via PyPI/pip.