Series1 partВиталий Лещенко

Windows containers by hand

A series about how Windows containers work from the inside — top to bottom, one layer of tooling at a time. We start with a Windows Server that has neither Docker nor Kubernetes: we install containerd, networking and nerdctl by hand and work through process isolation, networking, mounting folders and limits. Then we give containers names and addresses, look inside a running container, pull an image and prepare its layers without containerd, and finally do without a runtime altogether, creating a container and its network with direct HCS and HNS calls. The series ends with Hyper-V isolation, building an image without Docker and HostProcess containers.

The series builds on the Windows nodes block of the Kubernetes for beginners series (parts 36, 37, 38, 39, 40): the concepts are explained there, and what lies beneath them is covered here. All the examples were tested on Windows Server 2025 and are available in the windows-containers-by-hand repository.

  1. Part 1

    Installing containerd without Docker or Kubernetes

    On Windows Server 2025 without Docker or Kubernetes, containerd is installed from a GitHub archive into C:\Program Files\containerd, registered as a service with containerd --register-service, and immediately runs containers with process isolation. Networking comes from Microsoft's nat CNI plugin: it creates the HNS network nat itself, assigns containers addresses from an internal subnet and publishes ports with a policy on the HNS endpoint. nerdctl adds Docker's commands, can mount not only folders but also individual host files into a container, and passes the --memory and --cpus limits into the container spec, and Windows enforces them through a job object.

The series is not finished: the next parts are on their way.

  • Part 2: Giving containers names and addresses
  • Part 3: What is inside a running Windows container?
  • Part 4: Pulling an image and preparing layers without containerd
  • Part 5: Running a container without a runtime through HCS
  • Part 6: Hyper-V isolation: a container in its own virtual machine
  • Part 7: Building a Windows image without Docker and pushing it to a registry
  • Part 8: Running HostProcess containers and taking their image apart