Closed megel closed 5 years ago
Could you share the script you are using? That image works fine for me.
Has this been resolved?
I assume, it depends on the useBestContainerOS
Parameter. Since I have changed this to $false
it works.
# the relevant Parameters:
$additionalParameters += @("--volume ""${workspaceFolder}:${workspaceFolder}""", "--env httpSite=N", "--env WebClient=N")
$myscripts = @(@{'MainLoop.ps1' = 'while ($true) { start-sleep -seconds 10 }'})
$shortcuts = "None"
$useBestContainerOS = $true # set during some other stuff
New-NavContainer @parameters `
-containerName $containerName `
-imageName "$($imageversion.containerImage)" `
-auth NAVUserPassword `
-Credential $credential `
-alwaysPull:$imageversion.alwaysPull `
-updateHosts `
-includeCSide `
-doNotExportObjectsToText `
-enableSymbolLoading `
-useBestContainerOS:$useBestContainerOS `
-shortcuts $shortcuts `
-licenseFile "$licenseFile" `
-additionalParameters $additionalParameters `
-myScripts $myscripts
and you have navcontainerhelper 0.4.2.2?
ContainerHelpers should be the highest … Install-NavContainerHelper
is running first.
But I'll check again - the new Server2019 is currently in creation :) … take some minutes
Oh, Server 2019 fails on before New-Container: Strange - the second run of the build Pipeline runs - don't know what happened?
No - it runs into the same error:
and I have used: microsoft/bcsandbox:de and $useBestContainerOS = $false
I will try to set this up myself today.
This specific error seems to be because docker isn't running on the agent - I had the same. Connected to the agent with rdp - started the docker service (I might just include a start-service docker in one of the scripts). after that - success (very first run takes 25:42) second run - way faster (image already downloaded and vsts task already installed)
I am adding a new option (to use Windows Server 2019 with Containers) - this cuts the initial build down with 7-8 minutes to 18 minutes. The following builds are similar in perf.
Unfortunately, the hosted Windows Container Azure DevOps pool is still on 1803 - meaning that creation of build container will pull 2016 and spin up a 1803 container with the 2016 dvd image extract:
[section]******************************************************************************
[section]Starting: Create Build Container
[section]******************************************************************************
==============================================================================
Task : PowerShell
Description : Run a PowerShell script on Windows, macOS, or Linux.
Version : 2.140.2
Author : Microsoft Corporation
Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
==============================================================================
Generating script.
Formatted command: . 'D:\_work\1\s\scripts\Create-Container.ps1' -version "current" -credential ([PSCredential]::new("***", (ConvertTo-SecureString -String "***" -AsPlainText -Force))) -licenseFile "***"
[command]"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'D:\_work\_temp\362e401d-d7c6-47e0-8a80-30bac61ca619.ps1'"
Create helloworld-bld from microsoft/bcsandbox:us
Host is Windows 10 10.0.17134.0 - 1803
Pulling image microsoft/bcsandbox:us-ltsc2016
us-ltsc2016: Pulling from microsoft/bcsandbox
3889bb8d808b: Pulling fs layer
900b07d43172: Pulling fs layer
d5f1862af3b5: Pulling fs layer
cce31346ada7: Pulling fs layer
Which isn't very fast...
I have no idea why it's working now. Same build Agent / same AzureDevOps Project.
The only Change is, I have run your HelloWorld too and the container (also DE) are already present.
2018-12-04T09:18:53.9861669Z ##[section]Starting: Create Build Container
2018-12-04T09:18:53.9867153Z ==============================================================================
2018-12-04T09:18:53.9867332Z Task : PowerShell
2018-12-04T09:18:53.9867474Z Description : Run a PowerShell script on Windows, macOS, or Linux.
2018-12-04T09:18:53.9867612Z Version : 2.140.2
2018-12-04T09:18:53.9867718Z Author : Microsoft Corporation
2018-12-04T09:18:53.9867867Z Help : [More Information](https://go.microsoft.com/fwlink/?LinkID=613736)
2018-12-04T09:18:53.9868040Z ==============================================================================
2018-12-04T09:18:55.2339914Z Generating script.
2018-12-04T09:18:55.3145776Z ##[command]"C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command ". 'C:\Agent\_work\_temp\8ded3e40-06c9-48c5-b581-7f2991ac3697.ps1'"
2018-12-04T09:18:56.0658581Z Create iERP-bld from microsoft/bcsandbox:de (Workspace: 'C:\Agent')
2018-12-04T09:18:59.4945698Z Host is Windows Server 10.0.17763.0 - ltsc2019
2018-12-04T09:19:00.0376596Z Using image microsoft/bcsandbox:de-ltsc2019
2018-12-04T09:19:00.5337630Z Creating Nav container iERP-bld
2018-12-04T09:19:00.5344927Z Using license file ***
2018-12-04T09:19:00.6850902Z Version: 13.1.25940.26323-DE
2018-12-04T09:19:00.8442902Z Platform: 13.0.26198.0
2018-12-04T09:19:00.9825036Z Generic Tag: 0.0.8.0
2018-12-04T09:19:01.1317298Z Container OS Version: 10.0.17763.134 (ltsc2019)
2018-12-04T09:19:01.1323905Z Host OS Version: 10.0.17763.0 (ltsc2019)
2018-12-04T09:19:01.1973421Z Downloading C:\ProgramData\NavContainerHelper\Extensions\iERP-bld\my\license.flf
2018-12-04T09:19:01.5409939Z Creating container iERP-bld from image microsoft/bcsandbox:de-ltsc2019
2018-12-04T09:19:01.9758575Z c10d5798faa9985fadc59873a712d634386717f4d38c3046b463cbb9426e0f1e
2018-12-04T09:19:04.9240346Z Waiting for container iERP-bld to be ready
2018-12-04T09:19:12.3860224Z Initializing...
2018-12-04T09:19:12.3861797Z Starting Container
2018-12-04T09:19:12.3863740Z Hostname is iERP-bld
2018-12-04T09:19:13.5598613Z PublicDnsName is iERP-bld
2018-12-04T09:19:14.7608517Z Using NavUserPassword Authentication
2018-12-04T09:19:18.6036317Z Starting Local SQL Server
2018-12-04T09:19:19.9203845Z Creating Self Signed Certificate
2018-12-04T09:19:19.9205211Z Self Signed Certificate Thumbprint 9A49B0CFED59B5A8A7C1D67EBD2235C79D1B4510
2018-12-04T09:19:21.2133278Z Modifying Service Tier Config File with Instance Specific Settings
2018-12-04T09:19:26.5764728Z Starting Service Tier
2018-12-04T09:19:26.5766479Z Using license file 'c:\run\my\license.flf'
2018-12-04T09:20:43.3322479Z Import License
2018-12-04T09:20:44.6847474Z Creating Windows user ***
2018-12-04T09:20:44.6849975Z Setting SA Password and enabling SA
2018-12-04T09:20:44.6854114Z Creating *** as SQL User and add to sysadmin
2018-12-04T09:20:46.1989971Z WARNING: This license is not compatible with this version of Business Central.
2018-12-04T09:20:46.1992763Z Creating SUPER user
2018-12-04T09:20:46.1994409Z WARNING: This license is not compatible with this version of Business Central.
2018-12-04T09:20:53.3536209Z WARNING: This license is not compatible with this version of Business Central.
2018-12-04T09:20:53.3539898Z Container IP Address: 172.24.213.156
2018-12-04T09:20:53.3546829Z Container Hostname : iERP-bld
2018-12-04T09:20:53.3547662Z Container Dns Name : iERP-bld
2018-12-04T09:20:53.3548136Z
2018-12-04T09:20:53.3548700Z Initialization took 101 seconds
2018-12-04T09:20:53.3549236Z Ready for connections!
2018-12-04T09:20:53.3563469Z Reading CustomSettings.config from iERP-bld
2018-12-04T09:20:55.9329490Z Nav container iERP-bld successfully created
2018-12-04T09:20:56.0035788Z ##[section]Finishing: Create Build Container
The machine might have restarted and thereby started docker.
Windows 2019 with Containers … Fresh Setup with FinalSetupScript ... OK
It seems the issue has disappeared.
thanks
Build Agent Template
The Problems during container creation: Used OS: