【问题标题】:Is it possible to run PowerShell Core in a Linux dotnet container?是否可以在 Linux dotnet 容器中运行 PowerShell Core?
【发布时间】:2018-06-05 15:31:20
【问题描述】:

我可以看到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-sdkpwsh 的容器。

【问题讨论】:

    标签: docker .net-core powershell-core


    【解决方案1】:

    似乎最简单的解决方案就是等待 PowerShell Core that's going to support Ubuntu 18.04 的新版本发布——然后将其与 dotnet:2.1-sdk-bionic 匹配。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2018-03-22
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-03-31
      • 2019-08-28
      • 2020-02-06
      相关资源
      最近更新 更多