要解决这个问题,我们可以采用以下的步骤:
FROM microsoft/aspnetcore:2.0 WORKDIR /app COPY /bin/Release/PublishOutput . ENTRYPOINT ["dotnet", "MyApp.dll"]
{ "name": "my-task-definition", "image": "my-registry/my-image-name:latest", "essential": true, "memory": 512, "cpu": 256, "portMappings": [ { "containerPort": 80, "hostPort": 80 } ] }
{ "cluster": "my-cluster", "serviceName": "my-service-name", "taskDefinition": "my-task-definition", "desiredCount": 1, "deploymentConfiguration": { "maximumPercent": 200, "minimumHealthyPercent": 50 } }
通过这些步骤,我们可以确保我们的ASP.NET应用程序在AWS ECS上以正确的方式运行,并且不会出现意外退出Docker镜像的问题。