[英]Create a Dockerfile for a dot net (not dot net core) application
I'm trying to create a Dockerfile for a dot net application (C#).我正在尝试为点网应用程序(C#)创建一个 Dockerfile。
This application prints a string in the console when I run "OPCConsole.exe" from the terminal.当我从终端运行“OPCConsole.exe”时,此应用程序会在控制台中打印一个字符串。
I am trying to build the Dockerfile in such a way that once the docker run is done this string is printed in the terminal.我正在尝试构建 Dockerfile,这样一旦 docker 运行完成,此字符串就会打印在终端中。
My Dockerfile is:我的 Dockerfile 是:
# env .NET on DockerHub
# FROM mcr.microsoft.com/dotnet/sdk:6.0
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8
# copy all files in the folder
COPY . ./
# ENTRYPOINT ["./bin/Debug"]
# CMD ["OPCConsole.exe"]
RUN /bin/Debug
RUN OPCConsole.exe
Now I have this error:现在我有这个错误:
failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:3b60fb291ae58ea993c257c4da44423605b2d797c935b5d0ce1149ccccc87d6b: not found
Thanks for help!感谢帮助!
I suspect your are pulling mcr.microsoft.com/dotnet/framework/sdk:4.8
from a linux machine.我怀疑您正在从 linux 机器中提取
mcr.microsoft.com/dotnet/framework/sdk:4.8
。
If yes, as explainedhere , those images are for Windows only.如果是,如此处所述,这些图像仅适用于 Windows。
Infact, pulling it from my linux laptot I get:事实上,从我的 linux laptot 中取出它,我得到:
> docker pull mcr.microsoft.com/dotnet/framework/sdk:4.8
4.8: Pulling from dotnet/framework/sdk
no matching manifest for linux/amd64 in the manifest list entries
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.