yogihosting
yogihosting

Reputation: 6302

Unable to create DockerFile in Powershell Command

I am unable to create DockerFile in Powershell. The command I am using is:

FROM mcr.microsoft.com/dotnet/aspnet:3.1

The error I am getting is:

The 'from' keyword is not supported in this version of the language.

Here is the screenshot of it. enter image description here

You can clearly see I am running the command from the app directory which is: "D:\Website\Project\Dockers\App".

I am following the official microsoft docs for it. The link is here.

I have dockers desktop installed in running. It is running in Linux Containers mode.

What is wrong, something missing?

Upvotes: 0

Views: 163

Answers (1)

Mathias R. Jessen
Mathias R. Jessen

Reputation: 174660

PowerShell is not Docker, and PowerShell won't be able to parse or understand docker commands.

If you want to write a dockerfile from PowerShell, do like you would to write any other text file:

"FROM mcr.microsoft.com/dotnet/aspnet:3.1" |Add-Content .\Dockerfile

Upvotes: 1

Related Questions