DevOps – Containerized An ASP.NET Core Application Using VS Code

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.

Get Started

In my case, I have an ASP.NET Core application called cliapp which I created using .NET CLI in my last articles about DevOps.

Containerized application

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.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.