简体   繁体   English

在Windows中构建ASP.NET Core API Docker映像失败

[英]Building ASP.NET Core API Docker Image failed in windows

I am new in Docker world. 我是Docker世界的新手。 I create a simple ASP.NET Core API. 我创建一个简单的ASP.NET Core API。 I try to build a Docker image but I won't build. 我尝试构建Docker映像,但不会构建。

This is my docker file. 这是我的docker文件。

FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM microsoft/dotnet:2.2-sdk-nanoserver-1803 AS build
WORKDIR /src
COPY ["FirstDemo/FirstDemo.csproj", "FirstDemo/"]
RUN dotnet restore "FirstDemo/FirstDemo.csproj"
COPY . .
WORKDIR "/src/FirstDemo"
RUN dotnet build "FirstDemo.csproj" -c Release -o /app

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

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

and here is my error 这是我的错误

Step 1/17 : FROM microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803 AS base
2.2-aspnetcore-runtime-nanoserver-1803: Pulling from microsoft/dotnet
e46172273a4e: Pull complete
68aae72b77f3: Pull complete
02db7ef764ae: Pull complete
b85c87d0746a: Pull complete
8ded5310ea16: Pull complete
50f3c06b2324: Pull complete
57b0e03264f9: Pull complete
Digest: sha256:7b0c816859dca7eeab5ae92fea96090fb37fc966622649db0567f0c752552d4a
Status: Downloaded newer image for microsoft/dotnet:2.2-aspnetcore-runtime-nanoserver-1803
 ---> 422d1790b708
Step 2/17 : WORKDIR /app
 ---> Running in 8ae8be6cb8c0
**re-exec error: exit status 1: output: time="2019-02-19T23:15:48-05:00" level=error msg="hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) path=\\\\?\\C:\\ProgramData\\Docker\\windowsfilter\\*****  folder=C:\\ProgramData\\Docker\\tmp\\hcs815654479"
hcsshim::ImportLayer failed in Win32: The system cannot find the path specified. (0x3) path=\\?\C:\ProgramData\Docker\windowsfilter\****** folder=C:\ProgramData\Docker\tmp\hcs815654479**

I also find this question but it does not help me. 我也找到了这个问题,但对我没有帮助。 Please advice me. 请给我建议。

For those who might have the same issue. 对于那些可能有相同问题的人。

the problem was our security application ( CHECKPOINT- ENDPOINT Security) 问题是我们的安全应用程序(CHECKPOINT- ENDPOINT安全性)

it blocks the access of Docker to file system. 它阻止了Docker对文件系统的访问。 for now, we remove it, then everything is going well. 现在,我们将其删除,然后一切正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM