简体   繁体   English

如何在cmd中运行dockerfile

[英]How to run dockerfile in cmd

I am using Windows 10 machine and new to docker technology.我正在使用 Windows 10 机器并且不熟悉 docker 技术。

I prepared the Dockerfile.txt file and kept inside the DockerFiles folder in local system.我准备了 Dockerfile.txt 文件并保存在本地系统的 DockerFiles 文件夹中。

and executed the below command.并执行以下命令。

docker build -t my-r-image . docker build -t my-r-image 。

But it is not able to read.但它无法读取。

Can anyone please help?有人可以帮忙吗?

在此处输入图片说明

The name is also correct.名字也是对的。

Any suggestion will be highly appreciated.任何建议将不胜感激。

在此处输入图片说明

Make sure your dockerfile has the same name as the one shown in your terminal, example:确保您的dockerfile与终端中显示的名称相同,例如:

failed to solve with frontend dockerfile.v0: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount320670870/Dockerfile: no such file or directory

The dockerfile needs no extension, in Windows, you can create it with notepad++ and save it as "all types (.)" dockerfile不需要扩展名,在 Windows 中,您可以使用 notepad++ 创建它并将其保存为“所有类型 (.)”

You can try typing the full path of your dockerfile:您可以尝试输入 dockerfile 的完整路径:

docker build -t X:X O:\Users\yyy\XX

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM