找不到与命令“ dotnet-/ .. /。dll”匹配的可执行文件。在Linux上的Azure Web App中运行dotnet核心docker映像时 [英] No executable found matching command "dotnet-/../.dll" when running dotnet core docker image in Azure Web App on Linux

查看:445
本文介绍了找不到与命令“ dotnet-/ .. /。dll”匹配的可执行文件。在Linux上的Azure Web App中运行dotnet核心docker映像时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

1。背景



我目前正在研究以下构建/部署管道:


  1. Github(





2。问题



每当我将某些内容推送到Github存储库时,都会启动构建并正确执行步骤1-3。
但是,Azure上的网站无法访问。



我使用SCM浏览到调试控制台(



然后使用以下命令读取它们:

  cat docker_128_err.log 
cat docker_128_out.log

out日志显示以下结果(似乎正确):

 登录成功
最新消息:从devedse / devemazegeneratorcore
5040bd298390:已存在
fce5728aad85:Alrea dy存在
76610ec20bf5:已经存在
51ee4768b31d:已经存在
4dc55ff439a1:已经存在
9cb727c7d7a0:已经存在
2bea08464ad0:拉起fs层
2bea08464ad校验和
2bea08464ad0:下载完整
2bea08464ad0:拉取完整
摘要:sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d
ze状态:已下载更新的图像$ s b最新信息:从devedse / devemazegeneratorcore
中摘录:sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d
状态:devedse / devemazegeneratorcore:

但是错误日志显示以下错误:

  2017-01 -31T13:11:46.757760723Z找不到与命令 dotnet- / home / DeveMazeGeneratorCoreWebPublish / DeveMazeGeneratorWeb.dll匹配的可执行文件

奇怪的是,是每次在本地运行图像时,它都可以正常工作:

  docker run -it --rm -p 0.0.0.0:5001:80 devedse / devemazegeneratorcore:最新

与我本地安装的Docker镜像相比,在Azure的Linux机器上运行Docker镜像似乎有点不同,本地安装的Docker镜像在您安装Windows Docker时所安装的默认VM上运行。



3。使用的配置文件:



.travis.yml :( https://github.com/devedse/DeveMazeGeneratorCore/blob/master/.travis.yml
Dockerfile:( https://github.com/devedse/DeveMazeGeneratorCore/blob/master/Scripts/Docker/Dockerfile



4。总结



总而言之,似乎在Azure上运行Docker的方式与本地执行时的方式不同。有没有人知道这可能是什么/如何解决?



再次,(为便于参考),错误:

  2017-01-31T13:11:46.757760723Z找不到与命令 dotnet- / home / DeveMazeGeneratorCoreWebPublish / DeveMazeGeneratorWeb.dll匹配的可执行文件


解决方案

修改映像以将应用程序位放在/ home之外的其他地方。



/ home是Linux上的Azure应用服务绑定-永久站点卷的位置,该站点卷是跨实例共享的磁盘,并且在重新启动之间保持不变。



您不必使用它(运行自己的映像时可能没有任何用处),但是映像/ home中的任何内容在运行时都会消失


1. Background

I'm currently working on the following build/deployment pipeline:

  1. Github (https://github.com/devedse/DeveMazeGeneratorCore)

  2. Travis Build (https://travis-ci.org/devedse/DeveMazeGeneratorCore/jobs/196910720)

    • dotnet restore
    • dotnet build
    • dotnet publish
    • docker create image
    • docker publish image to hub
  3. Docker image hub (https://hub.docker.com/r/devedse/devemazegeneratorcore/)
  4. Use Azure Web App on Linux to execute deployment (http://devemazegeneratorcoredocker.azurewebsites.net/api/mazes/MazePath/512/512)
    • .

2. Problem

Whenever I push something to the Github repository, a build is kicked off and step 1-3 are being executed correctly. However, the website on Azure is unreachable.

I used SCM to browse to the debug console (https://devemazegeneratorcoredocker.scm.azurewebsites.net/DebugConsole/Default.cshtml (for future reference)) and executed the following commands to find the log files that were generated by Docker:

and then used the following commands to read them:

cat docker_128_err.log
cat docker_128_out.log

The out log showed the following results (which seem correct):

Login Succeeded
latest: Pulling from devedse/devemazegeneratorcore
5040bd298390: Already exists
fce5728aad85: Already exists
76610ec20bf5: Already exists
51ee4768b31d: Already exists
4dc55ff439a1: Already exists
9cb727c7d7a0: Already exists
2bea08464ad0: Pulling fs layer
2bea08464ad0: Verifying Checksum
2bea08464ad0: Download complete
2bea08464ad0: Pull complete
Digest: sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d
Status: Downloaded newer image for devedse/devemazegeneratorcore:latest
Login Succeeded
latest: Pulling from devedse/devemazegeneratorcore
Digest: sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d
Status: Image is up to date for devedse/devemazegeneratorcore:latest

The error log however, shows the following errors:

2017-01-31T13:11:46.757760723Z No executable found matching command "dotnet-/home/DeveMazeGeneratorCoreWebPublish/DeveMazeGeneratorWeb.dll"

The strange thing is, is that whenever I run the image locally, it all works fine:

docker run -it --rm -p 0.0.0.0:5001:80 devedse/devemazegeneratorcore:latest

Somehow there seems to be a difference in running a Docker image on a Linux machine in Azure, compared to my local Docker installation which runs the Docker images on the default VM that's being installed when you install Docker for Windows.

3. Configuration files used:

.travis.yml: (https://github.com/devedse/DeveMazeGeneratorCore/blob/master/.travis.yml) Dockerfile: (https://github.com/devedse/DeveMazeGeneratorCore/blob/master/Scripts/Docker/Dockerfile)

4. Summary

So summarizing, it seems that running Docker on Azure is being executed in a different manner then when doing this locally. Does anyone have an idea on what this could be/how to solve it?

Again, (just for easy reference), the error:

2017-01-31T13:11:46.757760723Z No executable found matching command "dotnet-/home/DeveMazeGeneratorCoreWebPublish/DeveMazeGeneratorWeb.dll"

解决方案

Modify your image to put your application bits somewhere other than /home.

/home is where Azure App Service on Linux bind-mounts the persistent site volume, which is a disk that is shared across instances and is persisted between restarts.

You don't have to use it (you may not have any use for it when running your own image), but anything in your image's /home will disappear at runtime.

这篇关于找不到与命令“ dotnet-/ .. /。dll”匹配的可执行文件。在Linux上的Azure Web App中运行dotnet核心docker映像时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆