I am trying to add host names to host file in the windows container with no success.
According to documentation, this should add an entry on host file
docker run -it --add-host me:127.0.0.1 microsoft/dotnet:nanoserver powershell
but i can't ping "me" from the container.
Looking up at host file i find no entry for me.
cat C:\Windows\System32\drivers\etc\hosts
returns only the entrys:
192.168.125.108 host.docker.internal
192.168.125.108 gateway.docker.internal
I also try to add by docker-compose file, but i am not familiar with the sintax:
Here is my docker-compose.override.yml
version: '3.4' services: trfout_wsrv: extra_hosts: - "me:127.0.1.1"
image: ${DOCKER_REGISTRY-}trfoutwsrv
build:
context: .\TRFOUT\TRFOUT_WSRV
dockerfile: Dockerfile