Microsoft Server 2016 Containers

Microsoft Server 2016 ContainersIn generalized terms, a container is an isolated place where an application can run without affecting the rest of the system and without the system affecting the application. Containers are the next evolution in virtualization that are available for use in Windows Server 2016.

From the perspective of a ‘containerized’ application, it appears as if the application is inside a freshly installed physical computer or a virtual machine. When you begin working with containers you will find many similarities between a container and a virtual machine. A container runs an operating system, has a file system and can be accessed over a network just as if it was a physical or virtual computer system, however, the technology and concepts behind containers are very different from that of virtual machines.

To better understand containers and to help make the distinction between virtual machines and containers I’ll introduce some of the common container terms.

Container Host

First up is the Container Host, which is a physical or virtual computer system configured with the Windows Server Container feature. A container host can run one or more Windows Server Containers.

Container Image

The next important term is the Container Image.  As modifications are made to a container’s file system or registry, such as when software is installed, those changes are captured in a ‘sandbox’. In some cases it may be desirable to capture the changes so that new containers can be created that will inherit the changes. Essentially, that’s an image container. Once the container has stopped you can either discard the sandbox containing the changes or you can convert it into a new container image. For example, let’s say that you have deployed a container from the Windows Server Core OS image. Then you install a SQL Server instance into this container. Creating a new image from this container would act as a deployable version of the container. This image would only contain the changes made to it (SQLServer), however it could serve as a layer on top of the Container OS Image.

Keep in mind that once a container has been started, all write actions like file system and registry modifications or software installations are captured in this ‘sandbox’ layer.

Containers are deployed from images. A container OS image is the first layer in what could be many image layers that ultimately make up a container. This image provides the operating system environment. A Container OS Image is immutable, that is, it cannot be modified.

Each time a container image is created the container image and all of its dependencies are stored in a local repository. These images can be reused many times on the container host. The container images can also be stored in a public or private repository such as DockerHub so that they can be used across many different container hosts.

Managing Containers

Windows Server Containers can be managed using either PowerShell or Docker. With either one of these tools you can create new containers, container images as well as manage the container lifecycle.

Developers benefit greatly from containers. When an application is containerized, only the application and the components needed to run the application are combined into an “image.” Containers are then created from this image as needed.  You can also use an image as a base to create another image, making image creation even faster. Multiple containers can share the same image, which means containers start very quickly and use fewer resources.

Because the container has everything it needs to run your application, they are very portable and can run on any machine that is running Windows Server 2016. You can create and test containers locally, then deploy that same container image to your company’s private cloud, public cloud or service provider.  With containers, developers can build an app in any language.

IT staff can use containers to provide standardized environments for their development, QA, and production teams. They no longer have to worry about complex installation and configuration steps. By using containers, the differences in OS installations and infrastructure are abstracted and are no longer a consideration for deployment.  Containers help create an infrastructure that is simpler to update and maintain.

Leave a Reply