CI / CD using github, Docker and Kubernetes

In my last post on this topic I got my basic ASP.NET Core Docker container up and running locally. The next step is to get it deployed to the Cloud! To do this in the quickest way possible I decided to use Docker Cloud for my automated build and to store my Docker image, and Azure Container Service (AKS) to host the application.

Automated build

The first step is to create a repository in Docker Cloud to host my Docker image. You can just use this as a registry and push any existing Docker images to it, but I decided to set up an auomated build to execute whenever I commit to my git repository. This will use my application’s Dockerfile to build a Docker image.

Once the build completes I have my completed Docker image, all ready to deploy.

Deploying to AKS

I mentioned before that I wanted to look at Kubernetes for service orchestration so decided to use it to run my test container. This is very easy to do with Azure Container Service (AKS) and all I had to do was follow their straightforward Quick Start tutorial, Deploy an Azure Container Service (AKS) cluster. Instead of deploying their Docker image I changed the manifest file to point to mine and, hey presto, a multi-node Cloud application!

Next up, a deeper dive into Kubernetes.


tl;dr

Commit to github, build and host on Docker Cloud, deploy on AKS. Easy, peasy!

Written on February 2, 2018

cloud (15) docker (9) k8s (4) netcoreapp (10)