Closed lbev7 closed 2 weeks ago
We've found some similar issues:
If any of the above are duplicates, please consider closing this issue out and adding additional context in the original issue.
Note: You can give me feedback by 👍 or 👎 this comment.
The problem is that you are using an outdated generic image. Add -alwaysPull to your New-BcContainer and you should be good.
Hi Freddy, you are correct, an outdated generic image caused this issue. This raises another question. We've used premade BC images to speed up build time. Now with -alwaysPull build time increases significantly, even in some situations builds would fail due to unavailablity of servers or low latency, making this approach unpractical.
We're planning now to refresh BC images on a monthly basis, especially before the BCContainerHelper upgrades. However, I am wondering if there is any more flexible solution for us that you could suggest?
Generic images are updated every month (around the 15th) and you should uptake every update to stay secure and functional.
Great, we'll adjust our jobs to update images at monthly basis somtime after 15th. Thanks for your assistance.
Describe the issue We recently upgraded BCContainerHelper from version 6.0.15 to 6.0.26. Since then, we've encountered issues when creating Docker containers for any BC version prior to 24. From what I understand, BC version 24 and later use PowerShell Core 7 internally, which seems to be the source of our issue.
During the container initialization process, New-BcContainer generates and runs an AdditionalSetup.ps1 script in the my container folder. This script contains pwsh.exe command, which causes error on BC versions below 24 due to the absence of PS7. In the version 6.0.15, AdditionalSetup.ps1 was not generated, as the relevant logic in line 1426 was introduced in versions 6.0.16 and 6.0.17.
While WinRM is active on the host machine, it is configured only to allow PowerShell remote access across our network and is not intended for BCContainerHelper operations.
Scripts used to create container and cause the issue
Full output of scripts
Additional context
Please let me know if I've misunderstood or overlooked any details.