Sunday, October 4, 2020

Docker in Azure

What is Azure Container Instances

Azure Container Instances (ACI) allows us to deploy individual containers in Azure without having to provision Virtual Machines.

It is kind of a serverless computing environment where we can deploy our applications as Docker containers in Azure Container Instances. 

Creating an Azure Container Registry (ACR)

 We can create an Azure Container Registry (ACR) in different ways, using Azure CLI or Azure Portal or Powershell. In this post, we shall see how to create an Azure Container Registry using Azure CLI. 

The first step in creating an Azure Container Registry (ACR) using Azure CLI is to log in to Azure CLI. Open a command prompt and enter the command.

What is Azure Container Registry?

 Azure Container Registry is like a private DockerHub in Azure. It is a managed private Docker registry service based on the open-source Docker Registry 2.0. Create and maintain Azure container registries to store and manage your private Docker container images and related artifacts.

We can configure to push the docker images into Azure Container Registry. Familiar tools such as Azure DevOps and Jenkins CI/CD pipeline can be configured to use Azure Container Registry as a build endpoint. 

Azure CLI

 Azure CLI (Command-line Interface) is a command-line tool for Manager azure services. It's like Angular CLI, it provides various commands to manage Azure services in an Account. Before we can start using Azure CLI we need to install it, the latest version of Azure CLI can be installed from the following site.

https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

Once Azure CLI is installed run the az --version command to make sure that the installation was done successfully. 

Thursday, October 1, 2020

Docker in Visual Studio

Create Docker Image with .Net Core executable

 In the previous post we saw how to create an Executable (.exe file)  for a .Net Core console application. In this post we shall see how to package this .exe into a Docker image and deploy it as a Docker Container. 

First we will have to create a Dockerfile, we will create this file in the publish folder where the publish results (.exe files) are created.    

Creating Executable from .Net Core Application

.Net Core applications by default will create .dll executables, in this post we shall see how to explicitly create a .exe using .Net Core, in the next post we will see how to use this .Exe and create a Docker image. 
Let’s start by creating a .Net Core Console App using Visual Studio.