How to assign IP address to windows server containers when we create network with binding physical interface

Expected behavior

Able to create transparent network that binds to physical networks and still support static IP assignment to the containers.

I noticed that one drawback when you bind the physical interface to docker transparent network, it always expects this physical interface handles DHCP. We cannot assign static IP address to containers nor we can provide the subnet range to network itself.

I do not have DHCP for this Physical network it is connected to TOR dumb switches and do not plan to create a DHCP server. I have containers in other machines connected to same switch which I need to connect to. Any ideas how can I do that ?

Actual behavior

docker network create -d transparent --subnet= -o“nic1” new_ns2
Error response from daemon: HNS failed with error : The object already exists.

docker run -itd --name test --net new_ns --ip microsoft/nanoserver
C:\Program Files\Docker\docker.exe: Error response from daemon: User specified IP address is supported only when connecting to networks with user configured subnets.


PS C:\Users\Administrator> docker info
Containers: 0
Running: 0
Paused: 0
Stopped: 0
Images: 1
Server Version: 17.03.1-ee-3
Storage Driver: windowsfilter
Logging Driver: json-file
Volume: local
Network: l2bridge l2tunnel nat null overlay transparent
Swarm: inactive
Default Isolation: process
Kernel Version: 10.0 14393 (14393.1358.amd64fre.rs1_release.170602-2252)
Operating System: Windows Server 2016 Datacenter
OSType: windows
Architecture: x86_64
CPUs: 6
Total Memory: 15.91 GiB
Name: A115
Docker Root Dir: C:\ProgramData\docker
Debug Mode (client): false
Debug Mode (server): false
Experimental: false
Insecure Registries:
Live Restore Enabled: false
PS C:\Users\Administrator> docker version
Version: 17.03.1-ee-3
API version: 1.27
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64

Version: 17.03.1-ee-3
API version: 1.27 (minimum version 1.24)
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Experimental: false

Steps to reproduce the behavior

  1. …docker network create -d transparent --subnet= -o“nic1” new_ns See the HNS error here

  2. …docker run -itd --name test --net new_ns --ip microsoft/nanoserver