Public Repository

Last pushed: 2 years ago
Short Description
LLVM-enabled Mono (C#) Docker image
Full Description

LLVM-enabled Mono (C#) Docker image

This image is based on the debian:jessie image and contains
Mono compiled with LLVM integration enabled.

Total size of this image is:


By default, the mono executable does not use the LLVM backend. You can enforce the use of LLVM
by using the --llvm argument when invoking mono or by setting the MONO_USE_LLVM environment
variable as in the below example.

If you would like to AOT-compile the Global Assembly Cache, execute /usr/local/bin/mono-gac-aot.
This script will use the LLVM backend and attempt to perform a full Ahead-Of-Time compilation of
mscorlib.dll and all assemblies in the GAC. This can take some time, and will likely compile
several assemblies that you may not need, though you can follow its pattern to execute a targeted
compilation of assemblies.

In order to save image space, the bugpoint, monodis, and mono-boehm executables have been
removed from the installation.

Usage Example

$ echo 'using System; class MainClass { public static void Main (string[] args) { Console.WriteLine ("Hello World from LLVM!"); } }' > qq.mono
$ docker run --rm -e MONO_USE_LLVM=1 -v "$(pwd)":/mnt neoeinstein/mono-llvm sh -c "mcs -out:/mnt/qq.exe /mnt/qq.mono && mono /mnt/qq.exe"

Once you have run these commands you will have qq.exe mono-executable in your
current directory, and you will get printed 'Hello World from LLVM!' on Mono!

Docker Pull Command