Azure Container Service is one of the solutions that Azure provides for us, to host our containerized software components without having to worry about provisioning VMs (low level solution with a lot of management overhead) or using Azure App service which is a very high level PaaS platform. It is almost something between an IaaS and a PaaS service.

In this post I’m going to show you how to use Docker Compose to build some images from your application, then later on, you can push that image to Azure Container Registry and Azure Container Service.

Create your application

So to get started, you can Open Visual Studio 2017, go File -> New -> Project and select the Asp.Net Core Web Application project template.

Make sure you check the “Enable Docker Support” check box on the wizard, and select Windows or Linux.

Then you can add your solution to a GIT repository, and push it to Github or Visual Studio Team Services.

I have pushed the code to this repo in case you want to see the docker files etc:

https://github.com/aramkoukia/Azure-Container-Service-Poc

Create a Container Image from Application Source

Now we are going to use Docker Compose can to build Docker images and then later on deploy these images to our Azure Container Service.

To build the Docker image you can run the docker-compose.yml file with the following command:

docker-compose up -d -f "C:\ACSPoc\Azure ContainerServicePoc\docker-compose.yml"

When completed, use the docker images command to see the created images.

docker images

Then you can run the docker ps command to see the running images: