使用docker运行dotnet 1.1 [英] Run dotnet 1.1 using docker

查看:1614
本文介绍了使用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]

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


你的意思是运行dotnet SDK命令?请从以下网址安装dotnet SDK
http://go.microsoft.com/。 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 https://github.com/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: http://go.microsoft.com/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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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