tushi0407
tushi0407

Reputation: 31

The ‘from’ Keyword is not supported in this version of language

While i am running following command in powershell in windows server 2016 :

FROM microsoft/windowsservercore RUN dism /online /enable-feature /all /featurename:iis-webserver /NoRestart

I am getting:

The ‘from’ Keyword is not supported in this version of language” error.

Please help me in getting this issue solved.

[EDIT]

Actually, I was wrong running FROM keyword in PowerShell. This will be dockerfile. Also when copy above from command in docker file and run:

 *docker build -t windowsserveriis .*

then I am getting:

ltsc2019: Pulling from windows/servercore no matching manifest for windows/amd64 10.0.14393 in the manifest list entries error.

Upvotes: 1

Views: 16729

Answers (2)

Metin
Metin

Reputation: 741

The very same post is posted in the docker forum.

Those lines are valid declarations in a Dockerfile.

You might want to read about how to write a Dockerfile and build docker images: https://docs.docker.com/engine/reference/builder/

It is the official documentation and generaly valid regardless whether you want to build a Linux or Windows based Docker image.

Maybee this one is more friendly for Windows user: https://learn.microsoft.com/en-us/virtualization/windowscontainers/manage-docker/manage-windows-dockerfile

Though, I just took a peek at it. I highly recommend the first link, as ressources outside the official Docker dokumentation sometimes suggest odd approaches ;)

Upvotes: 1

Jeff Zeitlin
Jeff Zeitlin

Reputation: 10754

According to Microsoft Docs on Keywords, there is currently no version of PowerShell that supports the From keyword; it is currently ‘reserved for future use’. If you have contradictory information from Microsoft, please provide references, and include the output of $psversiontable in support of your assertion.

Upvotes: 0

Related Questions