我试图在Windows桌面上本地运行Docker中的微服务(Windows Desktop Docker),我的docker文件内容如下:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0
WORKDIR /app
COPY . .
EXPOSE 80
ENTRYPOINT ["dotnet", "ScheduleService.dll"]
当我发出docker run命令以使用以下命令公开端口8081:80时,容器会自动退出。在Powershell上发出的运行命令如下:
docker run -d -p 8081:80 schedule
当我使用docker ps -a
命令检查docker时,得到以下输出:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
8d2869a886f9 schedule "dotnet ScheduleServ…" 7 seconds ago Exited (2147516561) 4 seconds ago gracious_joliot
f2c7e9b43b0b schedule "dotnet ScheduleServ…" 19 hours ago Exited (2147516561) 19 hours ago pedantic_cerf
显示退出。有人可以帮我吗?