代码之家  ›  专栏  ›  技术社区  ›  LukáÅ¡ Lánský

是否可以在linux dotnet容器中运行powershell core?

  •  1
  • LukáÅ¡ Lánský  · 技术社区  · 6 年前

    我可以看到里面没有电地狱 microsoft/dotnet :

    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 现在。

    1 回复  |  直到 6 年前
        1
  •  0
  •   LukáÅ¡ Lánský    6 年前

    似乎最简单的解决方案就是等待powershell核心的新版本 that's going to support Ubuntu 18.04 --然后把它和 dotnet:2.1-sdk-bionic .

    推荐文章