Docker with 'Navcontainerhelper' - 'New-NavContainer'

jensthomsenjensthomsen Member Posts: 173
Hi
I'm trying to get a docker up and running by use of the 'navcontainerhelper', but it doen't work:-( My script looks like this:

install-module navcontainerhelper -force
Write-NavContainerHelperWelcomeText
help new-navcontainer -detailed

New-NavContainer `
-containerName Nav2018CU2 `
-accept_eula `
-memoryLimit 3G `
-imageName "microsoft/dynamics-nav:2018-cu2-dk"`
-licenseFile "C:\NAV Docker Setup\2018-DK\Udvikler NAV 2018 inkl ISV_011217.flf"`
-IncludeCSide `
-doNotExportObjectsToText `
-enableSymbolLoading Y `
-auth Windows

when running it, I first get prompted for user and password which I guess is just my windows credentials? The script terminates with this error:

Get-Item : Cannot find path 'C:\WINDOWS\system32\Y\setup.exe' because it does not exist.
At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.2.6.5\ContainerHandling\New-NavContainer.ps1:170 char:24
+ ... vversion = (Get-Item -Path (Join-Path $navDvdPath "setup.exe")).Versi ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (C:\WINDOWS\system32\Y\setup.exe:String) [Get-Item], ItemNotFoundException
+ FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand

Any ideas?

Best Answer

Answers

  • RemkoDRemkoD Member Posts: 100
    I've tried with NavUserPassword and that worked like a charm.
    $secureVMAdminPassword = ConvertTo-SecureSTring 'randompass' -AsPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential ('someusername', $secureVMAdminPassword) 
    
    New-NavContainer `
        -containerName "container" `
        -imageName "microsoft/dynamics-nav:devpreview" `
        -accept_eula `
        -Credential $credential `
        -memoryLimit 3G `
        -updateHost `
        -useSSL `
        -includeCSide `
        -doNotExportObjectsToText
    
    (remove the auth parameter and include the Credential parameter)

    I haven't tried it with Windows authentication yet. I don't know if there are tips and tricks to it.
  • RemkoDRemkoD Member Posts: 100
    jensthomsen, I didn't read the full error. It seems that the authentication isn't the problem. You get an error on
    Join-Path $navDvdPath "setup.exe"
    

    You have not supplied a NAV DVD folder as parameter when you run New-NavContainer. I did not use that either. So I have looked up the documentation on this parameter with
    Get-Help New-NavContainer -full
    

    -navDvdPath <String>
    When you are spinning up a Generic image, you need to specify the NAV DVD path

    Required? false
    Position? 3
    Default value
    Accept pipeline input? false
    Accept wildcard characters? false

    -navDvdCountry <String>
    When you are spinning up a Generic image, you need to specify the country version (w1, dk, etc.)

    Required? false
    Position? 4
    Default value w1
    Accept pipeline input? false
    Accept wildcard characters? false

    It seems that the script some how ends up using a generic image. Have you pulled the image you want to use?
    docker pull microsoft/dynamics-nav:2018-cu2-dk
    

    Has been a while since I've played with this. But I hope this points you in the right direction.
  • jensthomsenjensthomsen Member Posts: 173
    Hi RemkoD
    Thx for your answer:-) The last part helped me...sems as my previously downloaded image has disappeared. Adding this line to my script helped me further:
    -alwaysPull Y
  • jensthomsenjensthomsen Member Posts: 173
    Hi again
    Just copying the powershell-script supplied from RemkoD at the top with
    -imageName "microsoft/dynamics-nav:2018-cu2-dk" `
    is working, but I'm not able to log on to neither c/side or windows or web-client??

    I would like to use windows-authentication, so I changed the script to:
    $secureVMAdminPassword = ConvertTo-SecureSTring 'randompass' -AsPlainText -Force
    $credential = New-Object System.Management.Automation.PSCredential ('someusername', $secureVMAdminPassword)
    $licensfilename = "C:\NAV Docker Setup\2018-DK\Udvikler NAV 2018 inkl ISV_011217.flf"
    New-NavContainer `
    -containerName "container" `
    -imageName "microsoft/dynamics-nav:2018-cu2-dk" `
    -accept_eula `
    //-Credential $credential `
    -licenseFile licensfilename`
    -auth Windows `
    -memoryLimit 3G `
    -updateHost `
    -useSSL `
    -includeCSide `
    -doNotExportObjectsToText

    But again: Getting this error:
    Get-Item : Cannot find path '\\-Credential\setup.exe' because it does not exist.
    At C:\Program Files\WindowsPowerShell\Modules\navcontainerhelper\0.2.6.5\ContainerHandling\New-NavContainer.ps1:170 char:24
    + ... vversion = (Get-Item -Path (Join-Path $navDvdPath "setup.exe")).Versi ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : ObjectNotFound: (\\-Credential\setup.exe:String) [Get-Item], ItemNotFoundException
    + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetItemCommand

  • RemkoDRemkoD Member Posts: 100
    Unless you're KFrellsen someone else has the same issue with connecting to the (web)client with the same 2018-cu2-dk image :D . https://github.com/Microsoft/navcontainerhelper/issues/93

    Also check https://blogs.msdn.microsoft.com/freddyk/2017/10/29/troubleshooting-nav-on-docker/

    I would recommend to get NavUserPassword to work before going for the Windows Authentication :)
  • jensthomsenjensthomsen Member Posts: 173
    Answer ✓
    I've got som help from Freddie on:
    https://github.com/Microsoft/nav-docker/issues/167
    This solved my problem:-)
Sign In or Register to comment.