Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/25.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
带SoapCore的.Net Core 3.1-如何在Docker中运行它?_.net_Docker_Soap_Docker Compose_Dockerfile - Fatal编程技术网

带SoapCore的.Net Core 3.1-如何在Docker中运行它?

带SoapCore的.Net Core 3.1-如何在Docker中运行它?,.net,docker,soap,docker-compose,dockerfile,.net,Docker,Soap,Docker Compose,Dockerfile,通常情况下,终结点将使用:。 如何从运行在单独容器中的客户端访问此文件?我尝试获取net core容器的ip,并替换了localhost 这是我的Dockerfile: FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env WORKDIR /app # Copy csproj and restore as distinct layers COPY *.csproj ./ RUN dotnet restore # Copy everyt

通常情况下,终结点将使用:。 如何从运行在单独容器中的客户端访问此文件?我尝试获取net core容器的ip,并替换了localhost

这是我的Dockerfile:

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build-env
WORKDIR /app

# Copy csproj and restore as distinct layers
COPY *.csproj ./
RUN dotnet restore

# Copy everything else and build
COPY . ./
RUN dotnet publish -c Release -o out

# Build runtime image
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
WORKDIR /app
COPY --from=build-env /app/out .
ENTRYPOINT ["dotnet", "dotnet_soap_example.dll"]
我运行它时使用了:

docker build -t dotnet_soap_example .
docker run -p 5000:5000 dotnet_soap_example

结果是:

warn: Microsoft.AspNetCore.DataProtection.Repositories.FileSystemXmlRepository[60]
      Storing keys in a directory '/root/.aspnet/DataProtection-Keys' that may not be persisted outside of the container. Protected data will be unavailable when container is destroyed.
warn: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[35]
      No XML encryptor configured. Key {89888afb-2afd-4798-8474-9b71d743a397} may be persisted to storage in unencrypted form.
info: Microsoft.Hosting.Lifetime[0]
      Now listening on: http://[::]:80
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Production
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /app

另外,当我创建项目时,我使用了:

dotnet new web
我安装了SoapCore NuGet软件包:

dotnet add package SoapCore

是否需要将此NuGet安装添加到Dockerfile中?

修复了它。将
5000:5000
替换为
5000:80