update docker file for nanoserver 1709 release#5252
update docker file for nanoserver 1709 release#5252TravisEz13 merged 3 commits intoPowerShell:masterfrom
Conversation
TravisEz13
commented
Oct 27, 2017
- merge nanoserver-insider image into main nanoserver docker file
- add argument validation
- fix minor issues
| Throw [String]$('['+$PSVersionTable.PSEdition+'] is not [Core]!') ; ` | ||
| } ; | ||
| # Copy Powershell Core from the installer containter | ||
| ENV ProgramFiles C:\Program Files |
There was a problem hiding this comment.
Are quotes needed here around c:\Program Files? A bigger question that I don't quite understand: Why are you defining it here and not using $env:ProgramFiles or %ProgramFiles%?
There was a problem hiding this comment.
No, this is a tested an working file.
There was a problem hiding this comment.
There are only two changes to the file. I added comments for the two changes. The file which was deleted, otherwise replaced the older file.
There was a problem hiding this comment.
What about my second question? I added it a little later via edit
There was a problem hiding this comment.
docker itself cannot use the container environment variables. This is used in docker commands.
|
|
||
| SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] | ||
|
|
||
| RUN if (!($env:PS_VERSION -match '^\d+\.\d+\.\d+(-\w+\.\d+)?$' )) {throw ('PS_Version ({0}) must match the regex "^\d+\.\d+\.\d+(-\w+\.\d+)?$"' -f $env:PS_VERSION)} |
| # escape=` | ||
| FROM microsoft/nanoserver:latest | ||
| # Args used by from statements must be defined here: | ||
| ARG NanoServerVersion=1709 |
There was a problem hiding this comment.
the values for these first arguments changed