docker debian中的Asp.netcore应用

时间:2018-07-09 11:28:26

标签: c# asp.net docker microservices

我在docker中运行容器时遇到问题,我的docker托管在服务器linux debian上 这是我的docker文件

FROM microsoft/aspnetcore:2.0 AS base
WORKDIR /app
EXPOSE 5000

FROM microsoft/aspnetcore-build:2.0 AS build
WORKDIR /src
COPY *.sln ./
COPY DockerWebPage/DockerWebPage.csproj DockerWebPage/
RUN dotnet restore
COPY . .
WORKDIR /src/DockerWebPage
RUN dotnet build -c Release -o /app

FROM build AS publish
RUN dotnet publish -c Release -o /app

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

这是我的控制台输出:

root@vps564358:~# docker build -t  dockerwebpage:dev /home/Container
Sending build context to Docker daemon    352MB
Step 1/18 : too much code for send all console build 
b1dd0b04c119: Pull complete
91ea08ab0cc9: Pull complete
7f2893df5d93: Pull complete
6ca202fa6c2e: Pull complete
31b4abd59648: Pull complete
Digest: sha256:1e4043c2484157e029d6b09a3149ebd01c5122f6b62f0a1b6c6f54b90500ea4b
Status: Downloaded newer image for microsoft/aspnetcore-build:2.0
 ---> e4e43a027c0b
Step 6/18 : WORKDIR /src
 ---> bf0be7525f14
Removing intermediate container 9ff4196e50dc
Step 7/18 : COPY *.sln ./
No source files were specified
root@vps564358:~# docker run -d -p 5000:5000 dockerwebpage:dev
9fe41e5b2237364e141ed575c02afc02755b8a751ba65e57a395a8b633b5d022

所以我认为之后我的Web应用程序可以正常工作,但是当我尝试连接到我的网站时,我遇到了一个错误:“连接被拒绝”

0 个答案:

没有答案