Docker Community Forums

Share and learn in the Docker community.

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


(Johntrivedi111) #1

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:172.12.23.40 windowscore


(Aferreira) #2

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

Tested with docker run and docker-compose


(Tribetest) #3

I’m having same issue with windows 10.

Tested with docker run


(Vidyas78) #4

Hey there

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