[ 28-Nov-2016: at the time of writing of this blog entry, there are few Docker tools for Visual Studio including “Dockerfile Language Service (Preview)” which simply does syntax highlighting and it is not described here ]
This blog entry collects my experience using the Docker extension for Visual Studio which makes the deployment of .Net Core Apps to Docker easier. I have installed the following pre-requisites to perform this review:
1.Microsoft Visual Studio 2015 Update 3
2.Microsoft .NET Core 1.0.1 RTM VS 2015 Tooling Preview 2
3.Docker For Windows 1.12.3-beta30
4.Visual Studio Tools for Docker Preview 0.41.0
Note that Docker For Windows does not use the docker-machine (which in turn used Oracle Virtual Box) but hyper-v. “Docker For Windows” is the recommended tool to run Docker natively in Windows 10. For previous versions, use the Docker Toolbox. By native, I mean that you can run Windows Server Containers (which achieve isolation through namespace and process isolation) or Hyper-V Containers (which encapsulates each container in a light weight VM) and access them via docker commands in PowerShell:
Docker for Windows also allows you to change the amount of CPU and RAM assigned to the Docker engine and sharing drives as seen in the images below. Note: sharing drives is not a specific feature of Windows Containers, it is only required for volume mounting in Linux containers but is required to share the volume where the Dockerfile is located.
So what does this plug-in do? Well, it basically makes easier to generate the artifacts that are required to deploy ASP.NET Core Web Apps in Docker. This is achieved via scaffolding with yeoman. yo docker scaffolds the files (incl. docker file, docker compose and the build script) into a project and then the language services make authoring Dockerfiles easier.
Once you have the scaffolded files in place you can start to debug and modify the source code until is good to commit to the source code repo.
Javier Andrés Cáceres Alvis