Creating an application with Docker support

So now VS2017 RC is out! This contains several nice features and native docker support.

In this Blogpost I’ll try to use the docker feature to host an ASP.Net Application and deploy it to the azure Portal with an continuous deployment.

This contains the following Steps:

  1. Creating an ASP.Net Core Webapplication (With Dockersupport)
  2. Configuring Continious deployment in VS

Create an ASP.Net Core Webapplication

First of all, you must create an ASP.Net Core Webapplication:

Creating Webapplication

After klicking “OK” you will get a example Webapplication that you can run by simply hitting F5 the F5 key. But now we must add the docker support, that is very simple for now. Just rightclick on you project and go to Add -> “Docker project support”.

additionalDockerFilesAfter doing that you will see that the start button has changed to docker and serveral Docker files have been added to the solution.

So when you now Hitting F5 you will start your webapplication in a linux docker container. That was simple huh?

Configuring Continuous build delivery

Now let’s setup continuous build delivery to Microsoft Azure Container Service. To do this, I’ll right click on the project and choose “Configure Continuous Delivery…”.  This will bring up a continuous delivery configuration dialog. On this dialog, your account with a valid subscription as well as An Azure subscription with a valid Container registry and a DC/OC orchestrator Azure Container Service. For the moment as I’m writing this article, it was only possible to use an DC/OC orchestrator ACS. After hitting OK, a dialog will pop-up to explain that the setup process started. You may consult the ‘Continuous Delivery Tools’ Output Windows to watch the progress.

Upon successful completion of the setup, the output window will display the configuration details used to create the build and release definitions on VSTS to enable continuous build delivery for the project to the ACS.

From this moment, every change on your code (and a successfully compile), will be published into the docker container