Unable to add host using --add-host in windows container

I am using docker run command’s --add-host option to add host to windows host file but it is not adding the entry. This works fine in linux container so was wondering if this option is available in windows container or not. My command line is as follows:

docker run -it --add-host=TestVM: windowscore


I’m having the same problem with Windows Server 2016 Datacenter.

Tested with docker run and docker-compose

1 Like

I’m having same issue with windows 10.

Tested with docker run

Hey there

Had anyone found an alternative or have any suggestion for this issue. Problem still exists with Windows 10. Thanks!