Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New-NavContainer ignores does not run myScripts #520

Closed
gintuoklis opened this issue Jul 15, 2019 · 7 comments

Comments

@gintuoklis
Copy link

commented Jul 15, 2019

Hey Guys,
For some reason scripts, specified with -myScripts parameter are not executed while creating new container.
I can see that it copies the files (AdditionalSetup1305.ps1) to 'my' folder on C:\ProgramData\NavContainerHelper\Extensions, but it's not executed.

Command:

New-NavContainer -accept_eula `
                 -containerName $containerName `
                 -imageName $imageName `
                 -additionalParameters @("--volume $lsinstallationdir\:$localpathoncontainer", "--env locale=nl-NL") `
                 -includeCSIDE `
                 -doNotExportObjectsToText `
		 -myScripts @($additionalScripts) `
                 -licenseFile $licensefile `
                 -shortcuts Desktop `
                 -useBestContainerOS `
                 -databaseServer "sqlserver" `
                 -databaseName "develop" `
                 -databaseCredential $databaseCredential `
                 -auth NavUserPassword `
                 -updateHosts

Logs:

NavContainerHelper is version 0.6.2.5
Host is Microsoft  - 1903
Docker Client Version is 18.09.2
Docker Server Version is 18.09.2
Using image mcr.microsoft.com/businesscentral/onprem:13.3.27233.0-ltsc2019
Creating Container develop
Using license file C:\WorkDocs\Licenses\NAV BC on Prem - 5194146 - 06052019.flf
Version: 13.3.27233.0-W1
Platform: 13.0.27183.0
Generic Tag: 0.0.9.5
Container OS Version: 10.0.17763.437 (ltsc2019)
Host OS Version: 10.0.18362.239 (1903)
A better Generic Container OS exists for your host (1903)
Using generic image mcr.microsoft.com/dynamicsnav:generic-1903
Generic Container OS Version: 10.0.18362.175 (1903)
Generic Tag of better generic: 0.0.9.9
WARNING: The container operating system matches the host operating system, but the revision is different.
If you encounter issues, you might want to specify -isolation hyperv
Using locale en-US
Using process isolation
Overriding default functionality to dump eventlog in container log every 2nd second. (use -dumpEventLog to avoid this)
Files in C:\ProgramData\NavContainerHelper\Extensions\develop\my:
- AdditionalOutput.ps1
- AdditionalSetup.ps1
- AdditionalSetup1305.ps1
- license.flf
- MainLoop.ps1
- SetupWebClient.ps1
- updatehosts.ps1
Creating container develop from image mcr.microsoft.com/dynamicsnav:generic-1903
e99b41705bbf61dcb7e242011f782fab75ae6ec90638c837eaf85cf282812fc9
Waiting for container develop to be ready
Installing Business Central
Installing Url Rewrite
Installing OpenXML
Installing DotNetCore
Starting Local SQL Server
Starting Internet Information Server
Copying Service Tier Files
Copying Web Client Files
Copying Windows Client Files
Copying PowerShell Scripts
Copying ConfigurationPackages
Copying Test Assemblies
Copying TestToolKit
Copying UpgradeToolKit
Copying Extensions
Copying ClientUserSettings
Copying ReportBuilder
Changing Database Server Collation to Latin1_General_100_CS_AS
SQL Server 2017 transmits information about your installation experience, as well as other usage and performance data, to Microsoft to help improve the product. To learn more about SQL Server 2017 data processing and privacy controls, please see the Privacy Statement.
Copying Cronus database
Modifying Business Central Service Tier Config File for Docker
Creating Business Central Service Tier
Installing SIP crypto provider: 'C:\Windows\System32\NavSip.dll'
Starting Business Central Service Tier
Installation took 240 seconds
Installation complete
Initializing...
Starting Container
Hostname is develop
PublicDnsName is develop
Using NavUserPassword Authentication
Import Encryption Key
Stopping local SQL Server
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
stop...
WARNING: Waiting for service 'SQL Server (SQLEXPRESS) (MSSQL$SQLEXPRESS)' to 
stop...
Creating Self Signed Certificate
Self Signed Certificate Thumbprint 5CE976F283A4C3BF5AF9F5E84A2DA3A9D830158F
Modifying Service Tier Config File with Instance Specific Settings
Restarting Service Tier
Registering event sources
Registering event sources
Creating DotNetCore Web Server Instance
Using license file 'c:\run\my\license.flf'
Import License
Creating http download site
Container IP Address: 172.25.177.84
Container Hostname  : develop
Container Dns Name  : develop
Web Client          : http://develop/NAV/
Dev. Server         : http://develop
Dev. ServerInstance : NAV

Files:
http://develop:8080/al-2.1.79379.vsix

Initialization took 158 seconds
Ready for connections!
Reading CustomSettings.config from develop
Creating Desktop Shortcuts for develop
Container develop successfully created

@gintuoklis gintuoklis changed the title New-NavContainer ignores myScripts while using "BestContainerOS" New-NavContainer ignores does not run myScripts Jul 15, 2019

@freddydk

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2019

What scripts are you missing? What are you overriding?

@gintuoklis

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

just install additional components (LS Toolbox) within those scripts.

@freddydk

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2019

which scripts?

@freddydk

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2019

If you place a file called AdditionalSetup1305.ps1 in the my folder - it doesn't get executed - it just gets placed there. Read here to learn how to override scripts:
https://freddysblog.com/2018/03/20/navcontainerhelper-overriding-scripts-in-nav-containers/

@gintuoklis

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

Wasn't it merging contents of 'myScript' into AdditionalSetup.ps1 in the past?

@gintuoklis

This comment has been minimized.

Copy link
Author

commented Jul 15, 2019

sorry, my bad. I have to call my file exactly AdditionalSetup.ps1. Then, scripts merges additional scripts into it.

@gintuoklis gintuoklis closed this Jul 15, 2019

@freddydk

This comment has been minimized.

Copy link
Contributor

commented Jul 15, 2019

Exactly - New-NavContainer will append things to existing AdditionalSetup - if you provide one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.