Windows Server containers: images, isolation and Docker
-
Phase 0: Before you start
-
Phase 1: The foundation
-
Phase 2: Core administration and security
-
Phase 3: Enterprise infrastructure
-
Phase 4: Troubleshooting step by step
-
Phase 5: Final project and career
Developers increasingly hand over apps as container images instead of installers. Windows Server containers let you run those images on Server 2025: each app gets its own isolated filesystem and processes, starts in seconds, and runs the same on a laptop, a server or a Kubernetes cluster.
In this lesson you’ll install a container runtime on SRV01, pull a Nano Server image, run and inspect containers, build your own image from a Dockerfile, keep data with a mount, and see which image versions a host can run.
| Time | You need | By the end you can |
|---|---|---|
| About 60 minutes, plus image downloads | SRV01 with internet access through LabNet and about 10 GB of space on C: | Install Docker on Windows Server, run, inspect and stop containers, build images, use mounts, and explain process and Hyper-V isolation |
What it is, in one line
Windows Server containers are lightweight, isolated environments that share the host’s Windows kernel but have their own files, registry and processes, created from images like Nano Server or Server Core.
In Simple Words
Lunch boxes in one fridge
An office fridge holds everyone’s lunch boxes. Each box is sealed, labelled and packed exactly how its owner wants. They all share the same fridge, cold air and power, but nobody’s soup leaks into someone else’s salad.
Containers are those lunch boxes, and the host is the fridge. A VM is more like giving everyone their own small fridge: stronger separation, but much heavier.
An image is the recipe card used to pack a box. Follow the same card anywhere, and you get the same lunch.
Engineer's View
Images, isolation, versions, runtimes
Images: Microsoft publishes base images on mcr.microsoft.com: Nano Server (small, for .NET and modern apps), Server Core (most compatibility, includes PowerShell) and Server (full API set). Tags like ltsc2025 name the Long-Term Servicing Channel release. Your images add layers on top with a Dockerfile.
Isolation: process isolation runs container processes directly on the host kernel, visible in the host’s process list; the image must be a Windows release the host supports (on Server 2025: ltsc2025 and ltsc2022 images). Hyper-V isolation wraps each container in a tiny utility VM with its own kernel, allowing older images and stronger separation, but needs virtualization support, which a VirtualBox VM like SRV01 doesn’t provide.
Runtimes: Windows Server doesn’t ship a container engine. Options are Docker CE/Moby (installed with Microsoft’s script, community supported), Mirantis Container Runtime (commercial), or containerd, which Kubernetes uses on Windows nodes.
Data: a container’s writable layer disappears when it’s removed. Anything that must survive goes in a volume or bind mount from the host. Containers suit stateless app tiers; domain controllers, DHCP and file servers stay as VMs.
How it works, step by step
Here’s how a container is put together from layers:
The base image layers are read-only and shared by every container that uses them, which is why the tenth container starts in seconds and uses little extra disk. Each container only adds a thin writable layer.
What you’ll run on SRV01:
- Install the Containers feature and Docker CE with Microsoft’s script.
- Pull the Nano Server ltsc2025 image and run a one-off container.
- Run a long-lived container, look inside it, and find its process on the host.
- Build saatlab/hello:1.0 from a Dockerfile.
- Persist data with a bind mount to D:\Data.
Hands-on Lab: Windows Server containers on SRV01
Start DC01 and SRV01. Take a snapshot of SRV01 called “Before containers”. Work on SRV01 in PowerShell as administrator.
1Install the container runtime
On SRV01, download and run Microsoft’s install script:
Set-Location C:\Scripts
Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/Windows-Containers/Main/helpful_tools/Install-DockerCE/install-docker-ce.ps1" -o install-docker-ce.ps1
.\install-docker-ce.ps1The script enables the Containers feature and restarts SRV01 if needed. After the restart, sign in again; the script continues and installs Docker as a service. If it doesn’t resume by itself, run it once more.
Then check:
docker version --format "Client {{.Client.Version}} {{.Client.Os}}/{{.Client.Arch}} - Server {{.Server.Version}} {{.Server.Os}}/{{.Server.Arch}}"
Get-Service docker | Select-Object Status, StartTypeYou should see something like this:
Client 27.x.x windows/amd64 - Server 27.x.x windows/amd64
Status StartType
------ ---------
Running Automatic✅ Checkpoint: docker version shows a Windows client and server, and the docker service is Running.
2Pull an image and run a container
On SRV01:
docker pull mcr.microsoft.com/windows/nanoserver:ltsc2025
docker images
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "hostname & ver"You should see something like this:
REPOSITORY TAG IMAGE ID CREATED SIZE
mcr.microsoft.com/windows/nanoserver ltsc2025 4e2a1c8b9f03 2 weeks ago 300MB
7c3e9a21b4d6
Microsoft Windows [Version 10.0.26100.NNNN]The container got its own random hostname, and its Windows version matches SRV01’s build 26100. --rm deletes the container when it exits; the image stays.
✅ Checkpoint: The Nano Server image is listed, and the container printed a random hostname and version 10.0.26100.
3Run a long-lived container and look inside
On SRV01:
docker run -d --name pinger mcr.microsoft.com/windows/nanoserver:ltsc2025 ping -t localhost
docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Image}}"
docker exec pinger cmd /c "dir C:\ /b"
docker inspect --format "{{.HostConfig.Isolation}}" pinger
Get-Process -Name PING | Select-Object Id, ProcessName, SessionIdYou should see something like this:
NAMES STATUS IMAGE
pinger Up 8 seconds mcr.microsoft.com/windows/nanoserver:ltsc2025
License.txt
Program Files
ProgramData
Users
Windows
process
Id ProcessName SessionId
-- ----------- ---------
4812 PING 2The container has its own tiny C: drive. Isolation is “process”, so the container’s PING.EXE shows up in SRV01’s own process list, in its own session. That’s the difference from a VM, where you’d never see the guest’s processes on the host.
Stop and remove it:
docker logs pinger --tail 2
docker rm -f pinger✅ Checkpoint: You saw the container’s files, its “process” isolation, and its PING process on the host, then removed it.
4Build your own image
On SRV01, create the build folder and files:
New-Item -ItemType Directory C:\Build -Force | Out-Null
'Hello from the SaatLab container image, version 1.0' | Set-Content C:\Build\hello.txt
@'
FROM mcr.microsoft.com/windows/nanoserver:ltsc2025
COPY hello.txt C:/app/hello.txt
CMD ["cmd", "/c", "type C:\\app\\hello.txt"]
'@ | Set-Content C:\Build\Dockerfile
docker build -t saatlab/hello:1.0 C:\Build
docker run --rm saatlab/hello:1.0You should see this at the end:
Hello from the SaatLab container image, version 1.0The Dockerfile is the recipe: start from Nano Server, add a file, set the default command. Anyone with the same Dockerfile and files builds the same image. In real projects, images are pushed to a registry such as Azure Container Registry and pulled by servers or Kubernetes nodes.
✅ Checkpoint: docker run saatlab/hello:1.0 prints the hello line.

5Keep data with a bind mount
On SRV01:
New-Item -ItemType Directory D:\Data\app -Force | Out-Null
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo written by a container> C:\data\out.txt"
Get-Content D:\Data\app\out.txtYou should see this:
written by a containerThe container is gone (because of --rm), but the file it wrote lives on in D:\Data\app on SRV01. Logs, uploads and databases always go in volumes or mounts like this.
✅ Checkpoint: D:\Data\app\out.txt exists on SRV01 after the container was removed.
Break It, Then Fix It
Two container surprises that catch every Windows admin once: an image built for an older Windows version, and data that vanishes.
1Break it: an image for an older Windows version
On SRV01, run a Server 2019 image:
docker run --rm mcr.microsoft.com/windows/nanoserver:1809 cmd /c verYou’ll get an error like this (after the pull):
docker: Error response from daemon: container 3f1d... encountered an error during CreateContainer: failure in a Windows system call: The operating system of the container does not match the operating system of the host. (0xc0370101)With process isolation, the container uses SRV01’s kernel, so the image must be a release the host supports. Server 2025 runs its own ltsc2025 images and, thanks to a stable kernel interface added in 2023, ltsc2022 images too, but not 2019 (1809) images.
Hyper-V isolation (--isolation=hyperv) would run the old image in a utility VM with its own kernel. SRV01 is itself a VirtualBox VM without nested Hyper-V, so that fails here too.
Fix it: use an image the host supports:
docker run --rm mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c ver
docker rmi mcr.microsoft.com/windows/nanoserver:1809When hosts move to a new Windows Server version, check every image against Microsoft’s compatibility table, and rebuild old ones on a newer base before the upgrade.
✅ Checkpoint: The 1809 image failed with “does not match the operating system of the host” and ltsc2025 works.

2Break it: data written inside a container
On SRV01, write a file inside a named container, then replace the container:
docker run --name app1 mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo important> C:\report.txt"
docker rm app1
docker run --name app1 mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "type C:\report.txt"You’ll see something like this:
The system cannot find the file specified.The new container started from the clean image; the old writable layer, with report.txt, was deleted with the old container. In production this is how logs and uploads disappear the first time a container is updated.
Fix it: write to a mount, so the file outlives any container:
docker rm app1
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "echo important> C:\data\report.txt"
docker run --rm -v D:\Data\app:C:\data mcr.microsoft.com/windows/nanoserver:ltsc2025 cmd /c "type C:\data\report.txt"You should see this:
important✅ Checkpoint: report.txt was lost with the container, and survives when written to the D:\Data\app mount.
This happened at work
The host upgrade that stopped every container
A team ran 40 internal services as Windows containers built on Server Core ltsc2019. Their hosts were due for replacement, so new servers were installed with Windows Server 2022, and the containers were moved over on a Saturday.
Not one container started. Every attempt failed with “The operating system of the container does not match the operating system of the host.” The new hosts were VMs on a platform without nested virtualization, so Hyper-V isolation wasn’t an option either.
The team moved everything back to the old hosts and spent the next two weeks rebuilding all 40 images on the ltsc2022 base and testing them.
The fix: image builds now run in a pipeline that can target several base versions, and host upgrades start with a compatibility test of every image.
The lesson: Windows containers are tied to the Windows versions the host supports. Treat a host upgrade as an image upgrade too.
Common mistakes and troubleshooting
| Mistake or symptom | What happens | What to do instead |
|---|---|---|
| “operating system of the container does not match the operating system of the host” | Image built for a release the host can’t run | Use a supported ltsc tag or Hyper-V isolation |
| Writing data inside the container | Data lost when the container is replaced | Volumes or bind mounts |
| Using Server Core when Nano Server would do | Huge images, slow pulls | Smallest base that runs the app |
| Running containers as a way to avoid patching | Old, vulnerable images | Rebuild images on the latest monthly base |
| Expecting Hyper-V isolation inside a VirtualBox VM | It fails | Process isolation, or a host with nested Hyper-V |
| Floating tags like latest in production | Unexpected changes on rebuild | Pin versions; update deliberately |
| Putting DCs or file servers in containers | Unsupported and fragile | Keep infrastructure roles in VMs |
| Forgetting the container runtime isn’t built in | “docker” not recognised | Install Docker CE, Mirantis or containerd |
| No registry or build process | Images built by hand differ | Dockerfiles in source control, built by a pipeline |
Interview questions
Click a question to open it. Under each one you’ll find what the interviewer is really looking for, and one good way to answer.
Fresher level
1. What is a container?
What they’re really checking: Do you know the basics?
How you could answer: An isolated environment that packages an app with its dependencies and shares the host’s kernel, starting much faster and lighter than a VM.
2. Which base images does Microsoft provide for Windows containers?
What they’re really checking: Do you know the options?
How you could answer: Nano Server, Server Core and Server, published on mcr.microsoft.com with tags like ltsc2025.
3. How do you keep data from a container?
What they’re really checking: Do you understand ephemeral storage?
How you could answer: Use volumes or bind mounts; the container’s own writable layer is deleted when it’s removed.
2–5 years experience
4. Explain process isolation and Hyper-V isolation.
What they’re really checking: Do you know Windows-specific isolation?
How you could answer: Process isolation shares the host kernel and needs an image release the host supports; processes are visible on the host. Hyper-V isolation runs each container in a lightweight VM with its own kernel, allowing older images and stronger separation.
5. Why might a Windows container fail to start after a host upgrade?
What they’re really checking: Can you diagnose version issues?
How you could answer: The image’s OS version isn’t supported by the new host for process isolation. Rebuild on a newer base or use Hyper-V isolation.
6. How do you install a container runtime on Windows Server 2025?
What they’re really checking: Have you done it?
How you could answer: Microsoft’s install-docker-ce.ps1 script for Docker CE, Mirantis Container Runtime for commercial support, or containerd for Kubernetes nodes.
Senior level
7. When would you run Windows workloads in containers versus VMs?
What they’re really checking: Do you think about fit?
How you could answer: Containers for stateless, modern or modernised app tiers that benefit from fast deployment and orchestration; VMs for infrastructure roles, stateful legacy apps, and anything needing full OS features.
8. How would you run Windows containers at scale?
What they’re really checking: Do you know orchestration?
How you could answer: Kubernetes with Windows node pools (AKS or on-premises with containerd), images in a registry, CI pipelines building per OS version, and monitoring and patching of nodes.
9. How do you keep container images secure?
What they’re really checking: Do you think about supply chain?
How you could answer: Rebuild monthly on patched bases, scan images, pin versions, use minimal bases, run as non-admin users like ContainerUser, sign images and restrict registries.
Quick quiz
Q1. What do containers share with the host in process isolation?
- Nothing
- The kernel
- Their own kernel
Show answer
B — That’s why image versions matter.
Q2. Which image is the smallest Windows base?
- Server
- Server Core
- Nano Server
Show answer
C — Use the smallest that runs your app.
Q3. Why did the 1809 (Server 2019) image fail on SRV01?
- No internet
- Server 2025 can’t run 2019 images with process isolation
- Docker was stopped
Show answer
B — Use ltsc2025 or ltsc2022, or Hyper-V isolation.
Q4. Where should a container write data that must survive?
- C:\ inside the container
- A volume or bind mount
- The image
Show answer
B — The writable layer is deleted with the container.
Q5. In the work story, what had to be done?
- Reinstall Docker
- Rebuild 40 images on the new base
- Buy new hardware
Show answer
B — Host upgrades are image upgrades too.
Quick recap
- Windows Server containers share the host kernel but have their own files and processes.
- Install a runtime (Docker CE script, Mirantis or containerd); Windows doesn’t include one.
- Server 2025 runs ltsc2025 and ltsc2022 images with process isolation; older ones need Hyper-V isolation.
- Build images with Dockerfiles; base layers are shared and read-only.
- Keep data in volumes or bind mounts.
- Infrastructure roles stay in VMs.
Next lesson
Lesson 31: AD sites and replication → You’ll create a second AD site, move DC02 into it, configure site links and subnets, force and monitor replication with repadmin, and look at RODCs for branch offices.
Further reading: Windows Server containers
Want to go deeper into Windows Server containers? Microsoft’s container environment setup guide covers runtimes, and the version compatibility page explains which images run on which hosts. You can also see the full plan for this course on the Windows Server Administration course page.
