Title: PowerShell installed as global tool with .NET 6 fails to run on Alpine 3.15 · Issue #16532 · PowerShell/PowerShell · GitHub
Open Graph Title: PowerShell installed as global tool with .NET 6 fails to run on Alpine 3.15 · Issue #16532 · PowerShell/PowerShell
X Title: PowerShell installed as global tool with .NET 6 fails to run on Alpine 3.15 · Issue #16532 · PowerShell/PowerShell
Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerShell 5.1 and PowerShell. Steps to reprodu...
Open Graph Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
X Description: Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh...
Opengraph URL: https://github.com/PowerShell/PowerShell/issues/16532
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PowerShell installed as global tool with .NET 6 fails to run on Alpine 3.15","articleBody":"### Prerequisites\n\n- [X] Write a descriptive title.\n- [X] Make sure you are able to repro it on the [latest released version](https://github.com/PowerShell/PowerShell/releases)\n- [X] Search the existing issues.\n- [X] Refer to the [FAQ](https://github.com/PowerShell/PowerShell/blob/master/docs/FAQ.md).\n- [X] Refer to [Differences between Windows PowerShell 5.1 and PowerShell](https://docs.microsoft.com/powershell/scripting/whats-new/differences-from-windows-powershell).\n\n### Steps to reproduce\n\nI've installed PowerShell as a global tool with .NET 6 in an Alpine 3.15 container. When attempting to run `pwsh`, it results in the following error:\r\n\r\n```\r\nPowerShell 7.2.0\r\nCopyright (c) Microsoft Corporation.\r\n\r\nhttps://aka.ms/powershell\r\nType 'help' to get help.\r\n\r\nOne or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)\r\nOne or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)\r\nCannot load PSReadline module. Console is running without PSReadline.\r\nProcess terminated. The type initializer for 'System.Management.Automation.PSObject' threw an exception.\r\n at System.Environment.FailFast(System.String, System.Exception)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)\r\n at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])\r\nSystem.TypeInitializationException: The type initializer for 'System.Management.Automation.PSObject' threw an exception.\r\n ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\n\r\nFile name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\n --- End of inner exception stack trace ---\r\n at System.Management.Automation.PSObject.get_Properties()\r\n at System.Management.Automation.HostUtilities.GetDollarProfile(String allUsersAllHosts, String allUsersCurrentHost, String currentUserAllHosts, String currentUserCurrentHost)\r\n at Microsoft.PowerShell.ConsoleHost.DoRunspaceInitialization(Boolean skipProfiles, String initialCommand, String configurationName, Collection`1 initialCommandArgs)\r\n at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode, String configurationName, Collection`1 initialCommandArgs)\r\n at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs)\r\n at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName)\r\n at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned)\r\n at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)\r\n```\r\n\r\nRepro Steps:\r\n\r\n1. Build the following Dockerfile (e.g. `docker build -t test .`):\r\n\r\n```Dockerfile\r\nFROM alpine:3.15\r\n\r\nRUN apk add --no-cache \\\r\n ca-certificates \\\r\n \\\r\n # .NET dependencies\r\n icu-libs \\\r\n krb5-libs \\\r\n libgcc \\\r\n libintl \\\r\n libssl1.1 \\\r\n libstdc++ \\\r\n zlib\r\n\r\n# Install .NET SDK\r\nRUN wget -O dotnet.tar.gz https://dotnetcli.blob.core.windows.net/dotnet/Sdk/6.0.100/dotnet-sdk-6.0.100-linux-musl-x64.tar.gz \\\r\n && mkdir -p /usr/share/dotnet \\\r\n && tar -C /usr/share/dotnet -oxzf dotnet.tar.gz \\\r\n && ln -s /usr/share/dotnet/dotnet /usr/bin/dotnet\r\n\r\n# Install PowerShell\r\nRUN dotnet tool install --global PowerShell\r\n\r\nENTRYPOINT [ \"/root/.dotnet/tools/pwsh\" ]\r\n```\r\n\r\n2. Run the container (e.g. `docker run --rm test`)\n\n### Expected behavior\n\n```console\nA successful execution into the shell of PowerShell\n```\n\n\n### Actual behavior\n\n```console\nOne or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)\r\nOne or more errors occurred. (The type initializer for 'System.Management.Automation.TypeAccelerators' threw an exception.)\r\nCannot load PSReadline module. Console is running without PSReadline.\r\nProcess terminated. The type initializer for 'System.Management.Automation.PSObject' threw an exception.\r\n at System.Environment.FailFast(System.String, System.Exception)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(System.String[], Int32)\r\n at Microsoft.PowerShell.ManagedPSEntry.Main(System.String[])\r\nSystem.TypeInitializationException: The type initializer for 'System.Management.Automation.PSObject' threw an exception.\r\n ---> System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.\r\n\r\nFile name: 'Microsoft.Management.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'\r\n --- End of inner exception stack trace ---\r\n at System.Management.Automation.PSObject.get_Properties()\r\n at System.Management.Automation.HostUtilities.GetDollarProfile(String allUsersAllHosts, String allUsersCurrentHost, String currentUserAllHosts, String currentUserCurrentHost)\r\n at Microsoft.PowerShell.ConsoleHost.DoRunspaceInitialization(Boolean skipProfiles, String initialCommand, String configurationName, Collection`1 initialCommandArgs)\r\n at Microsoft.PowerShell.ConsoleHost.DoCreateRunspace(String initialCommand, Boolean skipProfiles, Boolean staMode, String configurationName, Collection`1 initialCommandArgs)\r\n at Microsoft.PowerShell.ConsoleHost.CreateRunspace(Object runspaceCreationArgs)\r\n at Microsoft.PowerShell.ConsoleHost.DoRunspaceLoop(String initialCommand, Boolean skipProfiles, Collection`1 initialCommandArgs, Boolean staMode, String configurationName)\r\n at Microsoft.PowerShell.ConsoleHost.Run(CommandLineParameterParser cpp, Boolean isPrestartWarned)\r\n at Microsoft.PowerShell.ConsoleHost.Start(String bannerText, String helpText)\r\n at Microsoft.PowerShell.UnmanagedPSEntry.Start(String[] args, Int32 argc)\r\n```\n```\n\n\n### Error details\n\n_No response_\n\n### Environment data\n\n```powershell\nUnable to get this data since PowerShell can't be run.\n```\n\n\n### Visuals\n\n_No response_","author":{"url":"https://github.com/mthalman","@type":"Person","name":"mthalman"},"datePublished":"2021-11-30T18:07:13Z","url":"https://github.com/PowerShell/PowerShell/issues/16532"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:24be4b7c-0d94-af87-6a06-96bfc4811031 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA3A:34CE34:182B7:222FA:6AFDD526 |
| html-safe-nonce | 81ac41a55c0e37bcc53b9935a5b2d7d8cee1f0a75eee2d845159b9678f7ba5f1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTNBOjM0Q0UzNDoxODJCNzoyMjJGQTo2QUZERDUyNiIsInZpc2l0b3JfaWQiOiIyMjcwMzAzODYxNzM2MzMwNTM0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 5fa717d6d407f5fd98cec595927cf4373b8cc40d679888497c43db00986e788e |
| hovercard-subject-tag | issue:1067529796 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PowerShell/PowerShell/16532/issue_layout |
| twitter:image | https://opengraph.githubassets.com/b5d8af90bbf167b6773edc7d769efca5cc1212db41ad245a2160312b7ff3ce95/PowerShell/PowerShell/issues/16532 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/b5d8af90bbf167b6773edc7d769efca5cc1212db41ad245a2160312b7ff3ce95/PowerShell/PowerShell/issues/16532 |
| og:image:alt | Prerequisites Write a descriptive title. Make sure you are able to repro it on the latest released version Search the existing issues. Refer to the FAQ. Refer to Differences between Windows PowerSh... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mthalman |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9918bd4004419458bcd838065ac2a76b76ebd11705d73909fff5ab99e996fa23 |
| turbo-cache-control | no-preview |
| go-import | github.com/PowerShell/PowerShell git https://github.com/PowerShell/PowerShell.git |
| octolytics-dimension-user_id | 11524380 |
| octolytics-dimension-user_login | PowerShell |
| octolytics-dimension-repository_id | 49609581 |
| octolytics-dimension-repository_nwo | PowerShell/PowerShell |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 49609581 |
| octolytics-dimension-repository_network_root_nwo | PowerShell/PowerShell |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a231c174493a6a442c0b0544475c918b30128208 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width