This post is a wip, please check back for updates.
In this post I will give a detailed description of how to publish and deploy ASP.NET 5 applications to Linux using Visual Studio 2015 and Docker.
What is Docker?
I won’t describe Docker in detail in this post, as you can read more on their site here, but basically Docker allows you to package and deploy your applications to Docker containers.
Docker allows you to package an application with all of its dependencies into a standardized unit for software development.
Install Docker tools for Visual Studio 2015
Head over to the Visual Studio gallery site and install the Visual Studio 2015 Tools for Docker preview (I installed the November release, 0.9.1). Make sure you follow the prerequisite instructions exactly as you may run into problems at a later stage.
Create a test ASP.NET 5 application
Publish using Visual Studio – Part 1
Using VirtualBox to configure and host a Linux Server (Ubuntu)
Open VirtualBox and click new, enter a name and select “Create a virtual hard disk now”. Set the VM’s memory size to something reasonable. I set it to 4gb, but anywhere in the green section would have been fine for my laptop to handle.
A new dialog will appear to configure the virtual hard disk. Select ‘VDI’ and change the storage on physical hard disk to ‘fixed size’. For this example, I’ve set it to 16gb.
Click create and wait for VirtualBox to create the hard disk. Once it’s finished you should see a screen like this.
Installing Docker on Linux
Publish using Visual Studio – Part 2
In case anyone finds this useful, initially I kept getting the error message:
AspnetPublishHandler with name “[Custom]” was not found
After reinstalling everything (including Visual Studio 2015 community edition, ASP.NET 5 RC 1 and Docker tools for Visual Studio 2015 0.9.1), this problem finally went away!
Connection refused: https://blog.rendle.io/asp-net-5-dnx-beta8-connection-refused-in-docker/