Category

Docker

Continuous Integration, DevOps, Docker

CosmosDB linux container for your CI builds

If you have been following Microsoft Build 2021, you may have seen the news that the CosmosDB linux container is now out. This is great news for the ones who finally want to test on a *nix environment. As of this post, the CosmosDB linux container is in preview. As stated in the documentation, there are some limitations: Today, I will show you how you can automate the CosmosDB container for your CI builds, in particular Azure DevOps, running on Linux and Windows machines. If you plan to use the container on a machine running Windows, but using Docker Linux container mode, you will run into some Windows limitations while automating the process. Read more about that below. Using the…

Read more
Azure, C#, DevOps, Docker

Integration tests using Azure Storage emulator and .NET Core in Azure DevOps

I had a friend contact me about a situation that he was trying to do and I was about to have the same situation myself so I decided to tackle it. That situation is that we both need to test our code, but our code is dependent on Azure Storage. As you know, you can emulate Azure Storage on Windows using the (now deprecated) Azure Storage Emulator, or using Azurite. Since my code is built and tested on linux, I decided on using Azurite. Azurite v3 runs in a container. Azurite v2 runs using node.js but the container is not officially available. You need to build the image yourself. Azurite v2 is necessary if you need to have access to…

Read more
Docker

How-to: Push an image from docker registry to Azure Container Registry

With the Docker registry download limits, one way to circumvent those limits is to use your own registry, such as Azure Container Registry or for short ACR. This post will show you how to save an image from a Docker registry to an Azure Container Registry. How-To 1. Login to Azure Container Registry Pre-requirements: have az cli installed To login to ACR, in a command shell, type az acr login 2. Pull the image from Docker registry In my case I wanted to push the image mcr.microsoft.com/azure-storage/azurite to my ACR.

3. Tag the image To upload to ACR, you need to tag the image with the proper tag: name.azurecr.io/repostority/imagename:tag

Latest can be daunting. So I also tagged the image…

Read more
Docker, Kubernetes, Server administration

Installing a Kubernetes cluster on VMware vSphere and what I’ve learned

The topic of containers has been a hot topic for some time now. As a developer and architect, I want to be able to include them in my development SDLC for the various reasons you guys know. I won’t go in detail about them in this article, because after all you came to see how it was done right? :-). After having some container images waiting in a registry and awaiting to be used, I asked myself, how do I manage the deployment, management, scaling, and networking of these images when they will be spanned in containers? Using an orchestrator of course! Kubernetes (k8s) has become one of the widely used orchestrator for the management of the lifecycle of containers….

Read more
Docker

Accessing raw dd images in a Docker Linux container

I was backing up a Linux server of mine the other day and I wanted to have a full backup (along with regular tar.gz backups) of the main disk mounted on the /dev/sda partition. You can backup your partition using dd with a command such as dd if=/dev/sda | dd of=/home/archive/disk.img If everything works, you will get an output similar to below:

I was then looking to mount that backup raw image in order to check if everything was OK. You can do that by using the loop device in Linux. A loop device is a pseudo (“fake”) device (actually just a file) that acts as a block-based device1. My main OS is Windows and I did not have access to a Linux…

Read more
C#, Docker

Running an ASP.NET Core application targeting .NET Framework in Docker

Recently, I’ve came across an interesting challenge that was to dockerize an ASP.NET Core 2.2 application targeting .NET Framework 4.7.2. The reason this application was targeting .NET Framework was because it was using a library that unfortunately had no plans to move to the .NET Core platform. That library was a port from Java. As such I had to take a decision: rewrite the whole application in Java to support this library more natively, or try to find an alternative library that did the same thing. Sometimes it’s better to sleep on such decision. Well it paid off. I had forgotten that possibly I could use mono to run it. I took this as a challenge and used one of…

Read more
Azure, Docker

Connecting to Azure Redis Cache with Docker

If you are a Windows user and you want to access your Redis cache, you probably have realized that getting the redis-cli for Windows is not as easy as 1,2,3. You probably also wandered around the internet trying to find a free GUI that does the job of access Redis in a secure way (that is that is supports SSL/TLS out of the box). You then realized again that they probably have limitations themselves and it’s also not easy as 1,2,3. Your last solution, use the redis-cli that comes with the redis server on a linux flavored distro. Lucky for you, in Windows 10, you can install the Linux subsystem and then install redis which includes the redis-cli. Great, but…

Read more