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

查看:26
本文介绍了使用 docker 运行 dotnet 1.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的 Mac 上运行 .NET Core 应用程序.我正在使用 VS Core 并将项目升级到 .NET 1.1.当我通过 VSCode 运行它时一切正常,但是当我使用 Docker 运行它时却失败了.

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.

我执行以下步骤:

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

Dockerfile 如下所示:

The Dockerfile looks like this:

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

基本上我是按照 https://github.com/dotnet/dotnet-docker .我一直收到以下错误:

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

您的意思是运行 dotnet SDK 命令吗?请安装 dotnet SDK来自:http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409

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...

推荐答案

我将我的 dockerfile 更改为具有以下 COPY 语句:

I changed my dockerfile to have the following COPY statement:

COPY out ./

然后使入口点工作,因为它随后能够找到 myApp.dll.我认为这里的信息可以改进,但我假设这就是发生的事情

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天全站免登陆