是否可以在 Linux dotnet 容器中 运行 PowerShell Core?
Is it possible to run PowerShell Core in a Linux dotnet container?
我可以看到 microsoft/dotnet
中没有 Powershell:
C:\> docker run -it microsoft/dotnet:2.1-sdk bash
root@5397dac12c1e:/# pwsh
bash: pwsh: command not found
当我尝试按照以下方式添加它时,深受 PowerShell dockerfiles 的启发:
FROM microsoft/dotnet:2.1-sdk
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils ca-certificates curl apt-transport-https locales && rm -rf /var/lib/apt/lists/*
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
RUN apt-get update && apt-get install -y --no-install-recommends powershell
...步骤 RUN [...] apt-get install [...] powershell
失败
Fetched 10.3 MB in 11s (914 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
powershell : Depends: libssl1.0.0 but it is not installable
Depends: libicu55 but it is not installable
E: Unable to correct problems, you have held broken packages.
我想尝试在 Debian Stretch 容器中使用 Ubuntu 方法太大胆了。我想知道是否有更简单的方法来获取同时具有 dotnet-sdk
和 pwsh
的容器。
似乎最简单的解决方案就是等待新版本的 PowerShell Core that's going to support Ubuntu 18.04 -- 然后将其与 dotnet:2.1-sdk-bionic
匹配。
我可以看到 microsoft/dotnet
中没有 Powershell:
C:\> docker run -it microsoft/dotnet:2.1-sdk bash
root@5397dac12c1e:/# pwsh
bash: pwsh: command not found
当我尝试按照以下方式添加它时,深受 PowerShell dockerfiles 的启发:
FROM microsoft/dotnet:2.1-sdk
RUN apt-get update && apt-get install -y --no-install-recommends apt-utils ca-certificates curl apt-transport-https locales && rm -rf /var/lib/apt/lists/*
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list | tee /etc/apt/sources.list.d/microsoft.list
RUN apt-get update && apt-get install -y --no-install-recommends powershell
...步骤 RUN [...] apt-get install [...] powershell
失败
Fetched 10.3 MB in 11s (914 kB/s)
Reading package lists...
Reading package lists...
Building dependency tree...
Reading state information...
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
powershell : Depends: libssl1.0.0 but it is not installable
Depends: libicu55 but it is not installable
E: Unable to correct problems, you have held broken packages.
我想尝试在 Debian Stretch 容器中使用 Ubuntu 方法太大胆了。我想知道是否有更简单的方法来获取同时具有 dotnet-sdk
和 pwsh
的容器。
似乎最简单的解决方案就是等待新版本的 PowerShell Core that's going to support Ubuntu 18.04 -- 然后将其与 dotnet:2.1-sdk-bionic
匹配。