Since Microsoft and Docker now are partners, it has started to pop up a lot of tutorials on how to run Mono and ASP.NET vnext in Docker. Here are some good ones: Creating an ASP.NET vNext Docker Container using Mono, Getting Started with Docker on Microsoft Azure
This project is a simple PoC showing .Net running via Mono in a Docker container, completely isolated.
To try it out, simply install Docker (if you don't already have it!)
curl -sSL https://get.docker.com/ | sh
And then
git clone https://github.com/andmos/Docker-Mono.git
chmod +x DeployHelloWorld
./DeployHelloWorld
Or use the vagrantfile
:
vagrant up
vagrant ssh
cd /vagrant/
chmod +x DeployHelloWorld
./DeployHelloWorld
The Dockerfile looks for .exe's HelloWorldProject/bin/Debug
.
The app that is running is a simple HelloWorld - program in C#:
using System;
namespace HelloWorldProject
{
class MainClass
{
public static void Main (string[] args)
{
Console.WriteLine ("Hello World!");
}
}
}
But what about webapps?
The OWIN Katana project promises to take away the need for IIS. Lets try that in Docker:
git clone https://github.com/andmos/Docker-Mono.git
./DeployKatanaTest
Started! Hello from OWA Katana, running isolated in Docker!
Head over to http://localhost and see for yourself.
Oh, did I mention SingnalR runs on Katana?
Feel free to use the Dockerfile for Mono and do youre own testing and packing!
The Mono Dockerfile is also available on the public repository:
docker run andmos/mono
I have also written some words about using Vagrant and Docker to compile, test and deploy .NET code with Vagrant and Docker.
For a "production" example of SignalR running in Docker, I have contributed that part to this project. Check it out.
This project stands on the shoulders of giants.