tfenster/BCinaB

Support to update hosts file

Closed this issue · 1 comments

Suggestion to update hosts file the same way as navcontainerhelper does. Reason for asking is the network issue on Windows 1809 resulting in new ip-address for the containers after each reboot. The updatehosts option from navcontainerhelper resolves this.

Steps needed:

Create a volume to c:\windows\system32\drivers\etc

image

Copy updatehosts.ps1 to the my folder
File could be downloaded from https://raw.githubusercontent.com/Microsoft/navcontainerhelper/master/ContainerHandling/updatehosts.ps1 (and let's hope Freddy doesn't change that location)

Add a line to AdditionalOutput.ps1 to run updatehosts:
. (Join-Path $PSScriptRoot "updatehosts.ps1") -hostsFile "c:\driversetc\hosts" -hostname bcsandbox -ipAddress $ip

Only possible when you support navcontainerhelper as requested in the other issue.

@ajkauffmann I've implemented a more generic solution that not only works with NAV/BC containers and also is better at cleaning up (I hope ;) ). Give it a try when alpha6 is released and let me know if you like it