mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Add entry points to the windows docker files (#3462)
This commit is contained in:
committed by
Dongbo Wang
parent
9efbf56dd7
commit
7ceb1f6b84
@@ -1,5 +1,5 @@
|
||||
# escape=`
|
||||
FROM microsoft/nanoserver
|
||||
FROM microsoft/nanoserver:latest
|
||||
MAINTAINER brycem@microsoft.com
|
||||
LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md"
|
||||
LABEL Description="This Dockerfile will install the latest release of PS."
|
||||
@@ -32,11 +32,11 @@ RUN $ErrorActionPreference='Stop'; `
|
||||
[System.IO.Compression.ZipFile]::ExtractToDirectory($ZipFile,$PsFolder) ; `
|
||||
if (Get-ChildItem -Path $PsFolder/powershell.exe) { `
|
||||
Remove-Item -Path $ZipFile ; `
|
||||
New-Item -Type SymbolicLink -Path $PsFolder\ -Name Core -Value $PsFolder `
|
||||
New-Item -Type SymbolicLink -Path $PsFolder\ -Name latest -Value $PsFolder `
|
||||
} else { throw 'Installation failed! See c:\Dockerfile.log' } ;
|
||||
|
||||
# Verify New Powershell.exe runs
|
||||
SHELL ["C:\\Program Files\\PowerShell\\Core\\PowerShell.exe", "-command"]
|
||||
SHELL ["C:\\Program Files\\PowerShell\\latest\\PowerShell.exe", "-command"]
|
||||
RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ; `
|
||||
$ErrorActionPreference='Stop'; `
|
||||
Write-Output $PSVersionTable ; `
|
||||
@@ -45,4 +45,6 @@ RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ;
|
||||
} ;
|
||||
|
||||
# Persist %PSCORE% ENV variable for user convenience
|
||||
ENV PSCORE='"C:\Program Files\PowerShell\Core\PowerShell.exe"'
|
||||
ENV PSCORE='"C:\Program Files\PowerShell\latest\PowerShell.exe"'
|
||||
|
||||
ENTRYPOINT ["C:\\Program Files\\PowerShell\\latest\\PowerShell.exe"]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# escape=`
|
||||
FROM microsoft/windowsservercore
|
||||
FROM microsoft/windowsservercore:latest
|
||||
MAINTAINER brycem@microsoft.com
|
||||
LABEL Readme.md="https://github.com/PowerShell/PowerShell/blob/master/docker/README.md"
|
||||
LABEL Description="This Dockerfile will install the latest release of PS."
|
||||
@@ -32,11 +32,11 @@ RUN $ErrorActionPreference='Stop'; `
|
||||
if ($log -match 'Installation success or error status: 0') { `
|
||||
Remove-Item -Path $MsiFile ; `
|
||||
$psexe=Get-Item -Path $Env:ProgramFiles\PowerShell\*\powershell.exe ; `
|
||||
New-Item -Type SymbolicLink -Path $Env:ProgramFiles\PowerShell\ -Name Core -Value $psexe.DirectoryName `
|
||||
New-Item -Type SymbolicLink -Path $Env:ProgramFiles\PowerShell\ -Name latest -Value $psexe.DirectoryName `
|
||||
} else { throw 'Installation failed! See c:\PowerShell-win10-x64.msi.log' } ;
|
||||
|
||||
# Verify New Powershell.exe runs
|
||||
SHELL ["C:\\Program Files\\PowerShell\\Core\\PowerShell.exe", "-command"]
|
||||
SHELL ["C:\\Program Files\\PowerShell\\latest\\PowerShell.exe", "-command"]
|
||||
RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ; `
|
||||
$ErrorActionPreference='Stop'; `
|
||||
Write-Output $PSVersionTable ; `
|
||||
@@ -45,4 +45,6 @@ RUN Start-Transcript -path C:\Dockerfile.log -append -IncludeInvocationHeader ;
|
||||
} ;
|
||||
|
||||
# Persist %PSCORE% ENV variable for user convenience
|
||||
ENV PSCORE='"C:\Program Files\PowerShell\Core\PowerShell.exe"'
|
||||
ENV PSCORE='"C:\Program Files\PowerShell\latest\PowerShell.exe"'
|
||||
|
||||
ENTRYPOINT ["C:\\Program Files\\PowerShell\\latest\\PowerShell.exe"]
|
||||
|
||||
Reference in New Issue
Block a user