【问题标题】:.Net Core application running on a linux container在 linux 容器上运行的 .Net Core 应用程序
【发布时间】:2020-05-22 02:35:33
【问题描述】:

this link 之后,我构建了一个 .Net Core 应用程序,并且能够在 docker 容器中运行该应用程序。我的主机操作系统是 Windows 10,我现在想尝试在 Linux 容器中运行链接的应用程序。我已经切换到带有 Docker Desktop 的 Linux 容器。

当我构建 docker 映像时,我收到此错误:

failed to register layer: error creating overlay mount to /var/lib/docker/overlay2/f3e5279484774002c78a8eb66702c9ee7bca7038b59f4eeca7085b88dcbe25d9/merged: too many levels of symbolic links

我用过的 Dockerfile:

FROM mcr.microsoft.com/dotnet/core/runtime:3.1-nanoserver-1903 AS base
WORKDIR /app

FROM mcr.microsoft.com/dotnet/core/sdk:3.1-nanoserver-1903 AS build
WORKDIR /src
COPY ["NetCore.Docker/NetCore.Docker.csproj", "NetCore.Docker/"]
RUN dotnet restore "NetCore.Docker/NetCore.Docker.csproj"
COPY . .
WORKDIR "/src/NetCore.Docker"
RUN dotnet build "NetCore.Docker.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "NetCore.Docker.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "NetCore.Docker.dll"]

谢谢

【问题讨论】:

    标签: docker .net-core docker-container docker-desktop linux-containers


    【解决方案1】:

    原因是我使用了错误的镜像,不得不更改支持 linux 容器的镜像

    【讨论】:

      猜你喜欢
      • 2019-10-04
      • 2019-03-28
      • 1970-01-01
      • 2018-07-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-11-17
      • 1970-01-01
      相关资源
      最近更新 更多