试图创建Dockerfile,但无法正常工作。我正在了解错误信息。
错误:
如果我在命令提示符下尝试过:
C:\Users\admin\D1>touch Dockerfile
'touch' is not recognized as an internal or external command,
operable program or batch file.
如果我在VS Code终端中尝试过:
PS C:\Users\admin\D1> touch Dockerfile
touch : The term 'touch' is not recognized as the name of a cmdlet, function, script file, or operable
program. Check the spelling of the name, or if a path was included, verify that the path is correct and
try again.
At line:1 char:1
+ touch Dockerfile
+ ~~~~~
+ CategoryInfo : ObjectNotFound: (touch:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
如何解决此问题?
答案 0 :(得分:1)
尝试vi Dockerfile
或vim Dockerfile
(如果已安装,则可能有效)
答案 1 :(得分:0)
它不是特定于Dockerfile的东西,如果您要创建任何文件,它将是相同的。这样做的原因是您正在Windows命令提示符下尝试Linux命令。如果要使用这些命令,则需要首先在Windows计算机上使用基于* nix的工具。在Powershell中,我认为触摸等效于New-Item。