【发布时间】:2021-01-26 00:20:18
【问题描述】:
我正在使用 VS2019,并且在手动创建的 docker 容器中以及通过从 Visual Studio 生成的存根中部署了一个完美运行的服务。 VS 的发布实现没有问题,但是当我从 VS 的调试模式运行容器时,我的服务由于缺少其中一个依赖项而引发异常。
Dockerfile:
RUN apt-get update && apt-get install handbrake-cli -y //This is the only line which has been added to the VS2019 dockerfile stub.
ENTRYPOINT ["dotnet", "myapp.dll"]
在调试下观察到的行为,如果我启动 docker exec/CLI:
# apt-get install handbrake-cli
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package handbrake-cli
# apt-get update && apt-get install handbrake-cli
...
Reading state information... Done
The following additional packages will be installed:
...
# HandBrakeCLI
[14:11:51] hb_init: starting libhb thread
[14:11:51] thread 7eff9c606700 started ("libhb")
Missing input device. Run HandBrakeCLI --help for syntax.
HandBrake has exited.
#
很明显,在调试模式下,我的 Dockerfile 似乎没有应用更新和安装 handbrake-cli 的行。我曾尝试拆分更新并安装到单独的运行中,但是相同的行为仍然存在。在这一点上,我对自己做错了什么感到有点困惑,因为发布版本不会受到这个问题的影响。
【问题讨论】:
标签: linux docker .net-core visual-studio-2019 apt