【问题标题】:Dockerfile build error using Powershell for windows 10 and sdk 3.0Dockerfile 使用适用于 Windows 10 和 sdk 3.0 的 Powershell 构建错误
【发布时间】:2020-02-18 06:10:27
【问题描述】:

如果我使用 cmd 构建我的 docker 文件

docker build -t myimage -f Dockerfile。 收到此错误。 无法准备上下文:无法评估 Dockerfile 路径中的符号链接:CreateFile F:\Docker\demo\Dockerfile:系统找不到指定的文件。

【问题讨论】:

  • docker build -f Dockerfile.txt -t myimage .

标签: c# docker dockerfile sdk3.0


【解决方案1】:

Dockerfile 应该包含

来自 mcr.microsoft.com/dotnet/core/sdk:3.0 AS 构建 工作目录 /app

复制app/bin/Release/netcoreapp3.0/publish/app/

入口点 ["dotnet", "app/myapp.dll"]

从 powershell 运行时必须给出 dockerfile 扩展名

docker build -t myimage -f Dockerfile.txt .

【讨论】:

  • 请不要添加更多信息作为答案,您可以使用此信息编辑问题
猜你喜欢
  • 1970-01-01
  • 2019-04-03
  • 1970-01-01
  • 2013-07-02
  • 2017-08-15
  • 2016-01-31
  • 2016-02-27
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多