In this blog posts, I will show you how I containerised an ASP .NET Core application and produce a DockerFile using VS Code.
Microsoft Visual Code is an open source code editor for multiple languages including ASP.NET Core, Node.js and many more.
One of my favourite components in VS Code is the Docker extension that extends Docker management into VS Code and adds many administrative tools.
In my case, I have an ASP.NET Core application called cliapp which I created using .NET CLI in my last articles about DevOps.
To containerised my application, I click on View and select Command Palette…
From the command Palette, I search for Docker: Add Docker files to Workspace.
From the application, list platform click on ASP.NET Core
Next, I will select the Docker platform. In my case, I will use Linux containers.
I can also select the port number the application is using.
In the final selection screen, I will select the project name from the list.
After the process is complete, I will be presented with a Docker file I can simply run.
In my next, article I will show you how I run the DockerFile and test my application.