我正在尝试将我的 ASP.NET 4.7.2 WEB 服务构建到 docker 文件中,但是当我运行时
docker build -t manufacturing-portal-api:latest .
我收到以下错误:
failed to register layer: Error processing tar file(exit status 1): link /Files/Program Files/common files/system/ado/en-US/msader15.dll.mui /Files/Program Files (x86)/common files/system/ado/en-US/msader15.dll.mui: no such file or directory=> => sha256:d9e8b01179bfc94a5bdb1810fbd76b999aa52016001ace2d3a4c4bc7065a9601 1.66GB / 1.66GB 0.0s
这是我的 docker 文件
FROM microsoft/dotnet-framework:4.7.2-sdk-windowsservercore-1803 AS build
WORKDIR /app
# copy csproj and restore as distinct layers
COPY *.sln .
COPY WebPortalAPI/*.csproj ./WebPortalAPI/
COPY WebPortalAPI/*.config ./WebPortalAPI/
COPY ./instantclient_11_2 .
ENV PATH=./instantclient_11_2
ENV TNS_ADMIN=./instantclient_11_2/network/admin
RUN nuget restore
# copy everything else and build app
COPY WebPortalAPI/. ./WebPortalAPI/
WORKDIR /app/WebPortalAPI
RUN msbuild /p:Configuration=Release
FROM microsoft/aspnet:4.7.2-windowsservercore-1803 AS runtime
WORKDIR /inetpub/wwwroot
COPY --from=build /app/WebPortalAPI/. ./
请指教
答案 0 :(得分:5)
您的 Docker 主机可能配置为在虚拟机内运行 Linux 容器。要运行 Windows 容器,您需要在 Docker 菜单中“切换到 Windows 容器”。相关文档是 available here。