Azure app service docker container 'Service Unavailable'

≡放荡痞女 提交于 2019-12-07 03:11:35

问题


I have followed the tutorials for building a .net core web application into a docker image, publishing to an azure container registry, and then I have setup my VSTS Release template to deploy the container to the app service.

This all appears to work, I can view my image in the container registry, and the deployment appears to succeed - but when navigating to the app service site, all I get is an HTTP 503 - Service unavailable.

The app service is started, I can see deployments in my file system via bash - so I wondered if I am missing something?

I do not have a 'startup' command in any of my templates, I wondered if it could be this?

The site works perfectly from VS2017, including debugging via docker, so it really is just a case of... how do I get the App Service to actually load and execute the image?

Thank you!

EDIT

Further to this, I have got access to the docker diagnostics logs which claim "image operating system "windows" cannot be used on this platform".

My base image is the microsoft/aspnetcore:2.0 image, which runs perfectly fine on my linux container in my development environment... but appears to not work in the Linux App Service?

Is the aspnetcore:2.0 base image not suitable for a linux app service?


回答1:


I ended up resolving this week, hopefully the answer will help others.

When using VSTS Hosted build agents to produce images running off the docker base microsoft/aspnetcore:latest - unless you use the (Linux Preview) hosted build agent, you will get produced a windows container, which will not run on the linux app services.

Once I switched to using the hosted linux build agent, the container successfully loads, and my issue is resolved.




回答2:


Another solution for the same error message:

Try microsoft/aspnetcore (without the tag/version :2.0) as image. If that doesn't work, check the docker logs as mentioned above and look for a solution based on the exact error (usually a missing dependency).



来源:https://stackoverflow.com/questions/45940045/azure-app-service-docker-container-service-unavailable

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!