使用docker运行dotnet 1.1

编程入门 行业动态 更新时间:2024-10-10 15:28:29
本文介绍了使用docker运行dotnet 1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想在我的Mac上运行一个.NET Core应用程序。我使用VS Core并将该项目升级到.NET 1.1。当我通过VSCode运行它时,一切都可以正常运行,但是当我使用Docker运行它失败时。

我执行以下步骤:

dotnet publish -c Release -o out docker build -t myApp。

Dockerfile如下所示:

FROM microsoft / dotnet:1.1.0-preview1-runtime WORKDIR / service COPY out ./service/ ENTRYPOINT [dotnet,myApp .dll]

本质上,我按照 github/dotnet/dotnet-docker 。我得到所有的时间以下错误:

你的意思是运行dotnet SDK命令?请从以下网址安装dotnet SDK : go.microsoft/。 com / fwlink /?LinkID = 798306& clcid = 0x409

我不知道我在这里丢失了什么。

解决方案

我更改了我的docker文件以具有以下COPY语句:

COPY out ./

然后将entrypoint工作,因为它然后能够找到myApp.dll。我认为这个消息可以在这里得到改善,但这就是我假设发生了什么事。

I'm trying to run an .NET Core app on my mac. I'm using VS Core and upgraded the project to .NET 1.1. Everything works fine when I run it through VSCode however when I get to run it using Docker it fails.

I do the following steps:

dotnet publish -c Release -o out docker build -t myApp .

The Dockerfile looks like this:

FROM microsoft/dotnet:1.1.0-preview1-runtime WORKDIR /service COPY out ./service/ ENTRYPOINT ["dotnet", "myApp.dll"]

Essentially I'm following the steps from github/dotnet/dotnet-docker . I'm getting all the time the following error:

Did you mean to run dotnet SDK commands? Please install dotnet SDK from: go.microsoft/fwlink/?LinkID=798306&clcid=0x409

I'm not sure what I am missing here...

解决方案

I changed my dockerfile to have the following COPY statement:

COPY out ./

That then made the entrypoint to work because it was then able to find out myApp.dll. I think the message could be improved here, but that's me assuming that's what happened

更多推荐

使用docker运行dotnet 1.1

本文发布于:2023-11-16 14:42:40,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1605210.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:docker   dotnet

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!