microsoft / navcontainerhelper

Official Microsoft repository for BcContainerHelper, a PowerShell module, which makes it easier to work with Business Central Containers on Docker.
MIT License
383 stars 247 forks source link

Developing in Remote Container #2241

Closed RogerNelson66 closed 2 years ago

RogerNelson66 commented 2 years ago

PLEASE DO NOT INCLUDE ANY PASSWORDS OR TOKENS IN YOUR ISSUE!!!

Describe the issue is Developing in a Remote Container like discribed be the article: https://code.visualstudio.com/docs/remote/containers with navcontainerhelper possible?

Scripts used to create container and cause the issue

$containerName = 'bc180'
$password = 'xxx'
$securePassword = ConvertTo-SecureString -String $password -AsPlainText -Force
$credential = New-Object pscredential 'admin', $securePassword
$auth = 'UserPassword'
$artifactUrl = Get-BcArtifactUrl -type 'OnPrem' -version '18.0' -country 'at' -select 'Latest'
$licenseFile = 'c:\temp\DemDevBC18.flf'
New-BcContainer `
    -accept_eula `
    -containerName $containerName `
    -credential $credential `
    -auth $auth `
    -artifactUrl $artifactUrl `
    -licenseFile $licenseFile `
    -includeAL `
    -vsixFile (Get-LatestAlLanguageExtensionUrl) `
    -updateHosts `
    -additionalParameters @("--volume C:\temp\AddIns4Docker\BC180:C:\run\add-ins")

**Full output of scripts**

BcContainerHelper is version 2.0.22 BcContainerHelper is running as administrator Host is Microsoft Windows 10 Enterprise - 21H2 Docker Client Version is 20.10.11 Docker Server Version is 20.10.11 Removing C:\ProgramData\BcContainerHelper\Extensions\bc180 Fetching all docker images Fetching all docker volumes INFO: Windows 10 21H1/21H2 images are not yet available, using 2004 as these are found to work better than 20H2 on 21H1/21H2 Using image mcr.microsoft.com/businesscentral:10.0.19041.1415 Creating Container bc180 Style: onprem Multitenant: No Version: 18.0.23013.23795 Platform: 18.0.22893.23773 Generic Tag: 1.0.1.9 Container OS Version: 10.0.19041.1415 (2004) Host OS Version: 10.0.19044.1415 (21H2) WARNING: Host OS is 21H1 and Container OS is 2004, defaulting to process isolation. If you experience problems, add -isolation hyperv. Using process isolation Using locale de-AT Disabling the standard eventlog dump to container log every 2 seconds (use -dumpEventLog to enable) Downloading C:\ProgramData\BcContainerHelper\Extensions\bc180\Microsoft.VisualStudio.Services.VSIXPackage.vsix Using license file c:\temp\DemDevBC18.flf Files in C:\ProgramData\BcContainerHelper\Extensions\bc180\my:

Files: http://bc180:8080/Microsoft.VisualStudio.Services.VSIXPackage.vsix

Container Total Physical Memory is 15.7Gb Container Free Physical Memory is 2.6Gb

Initialization took 64 seconds Ready for connections! Reading CustomSettings.config from bc180 Creating Desktop Shortcuts for bc180 Extracting C:\Applications\BaseApp\Source\Base Application.Source.zip Creating .net Assembly Reference Folder for VS Code Copying DLLs from C:\Windows\assembly to assemblyProbingPath Copying DLLs from C:\Windows\Microsoft.NET\assembly to assemblyProbingPath Copying DLLs from C:\Program Files\Microsoft Dynamics NAV\180\Service to assemblyProbingPath Copying DLLs from C:\Program Files (x86)\Microsoft Dynamics NAV\180\RoleTailored Client to assemblyProbingPath Copying DLLs from C:\Test Assemblies\Mock Assemblies to assemblyProbingPath Copying DLLs from C:\Program Files (x86)\Open XML SDK to assemblyProbingPath Container bc180 successfully created

Use: Get-BcContainerEventLog -containerName bc180 to retrieve a snapshot of the event log from the container Get-BcContainerDebugInfo -containerName bc180 to get debug information about the container Enter-BcContainer -containerName bc180 to open a PowerShell prompt inside the container Remove-BcContainer -containerName bc180 to remove the container again docker logs bc180 to retrieve information about URL's again ...



**Screenshots**
If applicable, add screenshots to help explain your problem.

**Additional context**
if i try to attach to the container i'll get:

[69 ms] Remote-Containers 0.209.6 in VS Code 1.63.2 (899d46d82c4c95423fb7e10e68eba52050e30ba3).
[69 ms] Start: Resolving Remote
[71 ms] Setting up container: /bc180
[88 ms] Start: Run: docker inspect --type container /bc180
[1087 ms] Start: Check Docker is running
[1088 ms] Start: Run: docker version --format {{.Server.APIVersion}}
[1891 ms] Server API version: 1.41
[1892 ms] Start: Inspecting container
[1892 ms] Start: Run: docker inspect --type container ac935e58a8c2d3f370bd733eca2ffccaa5b750e84078d050b11c15b816e84f6a
[2878 ms] Start: Run in container: /bin/sh
[3008 ms] Start: Run in container: uname -m
[3956 ms] Start: Run in container: cat /etc/passwd
[3956 ms] Stdin closed!
[3962 ms] Shell server terminated (code: 126, signal: null)
container ac935e58a8c2d3f370bd733eca2ffccaa5b750e84078d050b11c15b816e84f6a encountered an error during hcsshim::System::CreateProcess: failure in a Windows system call: Der Benutzername oder das Kennwort ist falsch. (0x52e)
freddydk commented 2 years ago

Remove containers does not have support for Windows Containers yet:

(from the site) Containers:

and we cannot run BC etc. on Linux

Kowa63 commented 2 years ago

and we cannot run BC etc. on Linux

Since BC 20 will be the first version to run upon cross-platform .NET Standard rather than the .NET Framework in Windows, will that still apply for the versions to come? Or can we expect a BcContainerHelper on cross-platform PowerShell 7 (or higher when available) targeting Linux servers as soon as the technology permits it?

freddydk commented 2 years ago

I think that is all a matter of prioritization. Right now .NET Standard is the goal, whether we want to invest in a fully platform agnostic service tier depends on the price and the ROI - if it was cheap, we would probably do it now - my assumption is that the price tag is fairly high. Having said that, running all our service tiers on Linux (on Saas) would decrease the necessary CPU power / cost - Linux cores are cheaper than Windows Cores. We will have to wait and see.