How To Assign A Static IP Address To A Windows Container

In this article, I’ll show you how I assign a Static IP Address to a Windows Server Container running Windows Containers.

Before assigning a static IP address to a Windows Container we have to create a Network that will define the subnet that the container will be located.

Once the Network Is created, all we need to do Is assign the static IP address when creating the Container with Docker.

In the Docker command below, I’ll create a Transparent network with the subnet details the Container needs to be located.

In the example below, I have a network called TransparentNet3 which I’ll use this name when creating the Container.

docker network create -d transparent --subnet= --gateway= TransparentNet3

To verify that the network was created I’ll run

docker network ls

Next, I’ll create a Windows Container with a Static IP Address of

docker run -it --name nano03 --network=TransparentNet3 --ip nanoserver/iis

When the Container Is created, I’ll run an IPCONFIG to verify the IP Address


Related articles:

2 thoughts on “How To Assign A Static IP Address To A Windows Container”

Comments are closed.