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

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

问题描述

1.背景

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

  1. Github(.

2.问题

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

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

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

cat docker_128_err.log猫 docker_128_out.log

输出日志显示以下结果(看起来是正确的):

登录成功最新:从 devedse/devemazegeneratorcore 中提取5040bd298390:已经存在fce5728aad85:已经存在76610ec20bf5:已经存在51ee4768b31d:已经存在4dc55ff439a1:已经存在9cb727c7d7a0:已经存在2bea08464ad0:拉取 fs 层2bea08464ad0:验证校验和2bea08464ad0:下载完成2bea08464ad0:拉取完成摘要:sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d状态:为 devedse/devemazegeneratorcore 下载了较新的图像:最新登录成功最新:从 devedse/devemazegeneratorcore 中提取摘要:sha256:647f3db3daa3330b7eb109a1c604e5bd403c2c7089b3c18c5e9249a9805d3a4d状态:图像是最新的 devedse/devemazegeneratorcore:latest

然而,错误日志显示以下错误:

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

奇怪的是,每当我在本地运行图像时,一切正常:

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

与我的本地 Docker 安装相比,在 Azure 中的 Linux 机器上运行 Docker 映像似乎有所不同,后者在安装 Docker for Windows 时安装的默认 VM 上运行 Docker 映像.

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 core docker 映像时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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