Reader small image

You're reading from  Mastering Windows Server 2019, Third Edition - Third Edition

Product typeBook
Published inJul 2021
PublisherPackt
ISBN-139781801078313
Edition3rd Edition
Concepts
Right arrow
Author (1)
Jordan Krause
Jordan Krause
author image
Jordan Krause

Jordan Krause has been an IT professional for more than 20 years and has received 9 Microsoft MVP awards for his work with Microsoft server and networking technologies. One of the world's first experts on Microsoft DirectAccess, he has a passion for helping companies find the best ways to enable a remote workforce. Committed to continuous learning, Jordan holds certifications as an MCSE, MCSA, and MCITP Enterprise Administrator, and has authored numerous books on Microsoft technologies. Jordan lives in beautiful West Michigan (USA), but works daily with companies around the world.
Read more about Jordan Krause

Right arrow

Containers and Nano Server

Many of the new technologies included in Windows Server 2019 are designed to reflect capabilities provided by cloud computing, bringing your private clouds to life and granting you the ability to produce the same solutions given to you by public cloud providers within your physical infrastructure. The last few iterations of the Server operating system have also revolved around virtualization, and the idea of application containers is something that taps into both of these mindsets. Application containers will make the deployment of applications more streamlined, more secure, and more efficient. Containers are a relatively new idea in the Microsoft world, and outside of conversations about DevOps, I haven't heard many IT admins talking about them yet. This is something that has been enhancing Linux computing for a while now, and this newest Windows Server operating system brings it a little bit closer to home for us Microsoft-centric shops.

Application...

Understanding application containers

What does it mean to contain an application? We have a pretty good concept these days of containing servers through virtualization. Taking physical hardware, turning it into a virtualization host-like Hyper-V, and then running many virtual machines (VMs) on top of it is a form of containment for those VMs. We are essentially tricking them into believing that they are their own entity, completely unaware that they are sharing resources and hardware with other VMs running on that host. Although we are sharing hardware resources, we can provide strong layers of isolation between VMs, because we need to make sure that access and permissions cannot bleed across VMs – particularly in a cloud provider scenario, as that would spell disaster.

Application containers are the same idea, at a different level. While VMs are all about virtualizing hardware, containers are more like virtualizing the operating system. Rather than creating VMs to host...

Containers and Nano Server

This topic wraps us back around to our discussion about Nano Server and why it has partially disappeared as a Windows Server installation option. Before discussing the purpose that Nano Server now serves, let's take a quick look at the structure of a Windows-based container. Here is a graphic similar to one from a public slide deck that was part of a Microsoft Ignite presentation:

Figure 13.1: Layers of a Windows container

The lowest layer of a container is the base operating system. When spinning up a container, you need a base set of code and a kernel from which to build upon. This base operating system can be either Server Core or Nano Server.

The next layer of a container is the customization layer. This is where the technologies that will ultimately be used by your application reside. For example, our containers may include IIS for hosting a website, PowerShell, or even something such as .NET. Any of these toolsets reside in this...

Windows Server containers versus Hyper-V containers

When spinning up your containers, it is important to know that there are two categories of containers that you can run in Windows Server 2019. All aspects of application containers that we have been talking about so far apply to either Windows Server containers or to Hyper-V containers. Hyper-V containers can run the same code or images as Windows Server containers, while keeping their strong isolation guarantees to make sure the important stuff stays separated. The decision between using Windows Server containers or Hyper-V containers will likely boil down to what level of security you need your containers to maintain. Let's discuss the differences between the two so that you can better understand the choice you are facing.

Windows Server containers

In the same way that Linux containers share the host operating system kernel files, Windows Server containers make use of this sharing in order to make the containers efficient...

Docker and Kubernetes

Docker is an open source project – a toolset, really – that was originally designed to assist with the running of containers on Linux operating systems. Wait a minute, what? The words Linux and open source written once again inside a Microsoft book! What is this world coming to? You see, containers are quickly becoming a big deal, and rightfully so. In Server 2016, Microsoft took some steps to start reinventing the container wheel, with the inclusion of PowerShell cmdlets that could be used to spin up and control containers running on your Windows Server, but the Docker platform has been growing at such a fast rate that Microsoft now expects that anyone who wants to run containers on their Windows machines is going to do so via the Docker toolset. If you want to utilize or even test containers in your environment, you'll need to get Docker for Windows to get started.

Docker is a container platform. This means that it provides the commands...

Working with containers

There are a lot of moving pieces that work together to make containers a reality in your environment, but it's not too difficult to get started. Let's walk through the initial setup of turning Windows Server 2019 into a container-running mega machine.

Installing the role and feature

The amount of work that you need to accomplish here depends on whether you want to run Windows Server containers, Hyper-V containers, or both. The primary feature that you need to make sure that you install is Containers, which can be installed by using either the Add roles and features link from inside Server Manager, or by issuing the following PowerShell command:

Add-WindowsFeature Containers

Figure 13.4: Installing the Containers feature

Additionally, if you intend to run Hyper-V containers, you need to ensure that the underlying Hyper-V components are also installed on your container host server. To do that, install the Hyper-V role and accompanying...

Summary

Containers are revolutionizing the way that we build and host modern applications. By containerizing apps, we can run many more applications on each physical server, because they are capable of being fully isolated away from each other. Additionally, the container mentality allows the development of applications to happen in a much more fluid fashion. App developers can build their applications inside containers running on their own laptops, and once finished, simply hand them over to the infrastructure team to slide that container image onto a production container host server. That host server could be on premises, or even in the cloud. Orchestration tools such as Kubernetes can then be leveraged to scale that application, increasing or decreasing resource capacity and the number of necessary containers based on load or other factors. Usability of containers in the real world has been expanded greatly by the Docker project. The folks at Docker are clearly the front-runners...

Questions

  1. A Windows Server container can run a base OS that is one of two different types. What are they?
  2. Compared to a Windows Server container, what type of container provides even greater levels of isolation?
  3. True or False—In Windows Server 2016, you could run both Windows and Linux containers on the same Windows Server host platform.
  4. What is the Docker command to see a list of container images on your local system?
  5. What is currently the most popular container orchestration software that integrates with Windows Server 2019?
  6. True or False—Developers can install Docker onto their Windows 10 workstations to start building applications inside containers.
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Mastering Windows Server 2019, Third Edition - Third Edition
Published in: Jul 2021Publisher: PacktISBN-13: 9781801078313
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime

Author (1)

author image
Jordan Krause

Jordan Krause has been an IT professional for more than 20 years and has received 9 Microsoft MVP awards for his work with Microsoft server and networking technologies. One of the world's first experts on Microsoft DirectAccess, he has a passion for helping companies find the best ways to enable a remote workforce. Committed to continuous learning, Jordan holds certifications as an MCSE, MCSA, and MCITP Enterprise Administrator, and has authored numerous books on Microsoft technologies. Jordan lives in beautiful West Michigan (USA), but works daily with companies around the world.
Read more about Jordan Krause