Pythonnet Docker

Python + Mono + pythonnet, in a Docker image
Alternatives To Pythonnet Docker
Select To Compare


Docker images with Python + Mono + pythonnet

Docker images with various combinations of 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)


The 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 Python images are used as base images. The -stretch variant of the Python Docker images is used because the slimmer variants (-slim and -alpine) do not include the tooling required for the Mono and pythonnet installs later.
  • Mono provides succinct documentation for installing on Debian systems, including steps for 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 project's issue tracker contains a wealth of detailed reports of problems and solutions.

Notes on available versions/tags


The Python versions included are a subset of those available in the Python Dockerhub repository, excluding pre-release versions. The Python Dockerhub repository generally includes the latest stable version of every 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 maintenance effort.


Mono versioning is non-obvious to the 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 Docker images here, we install via PyPI/pip.

Popular Virtualization Categories

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.