Skip to content

Commit

Permalink
Merge pull request #442 from lemeurherve/patch-1
Browse files Browse the repository at this point in the history
feat: use a multi-stage image for Windows Server Core
  • Loading branch information
dduportal committed Jul 1, 2023
2 parents e723d4c + 9f0b64a commit 8fdc902
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions windows/windowsservercore-ltsc2019/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@
# THE SOFTWARE.

ARG JAVA_VERSION=17.0.7_7
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809
FROM eclipse-temurin:"${JAVA_VERSION}"-jdk-windowsservercore-1809 AS jdk-core

FROM mcr.microsoft.com/powershell:windowsservercore-1809

ARG JAVA_HOME="C:\openjdk-17"
ENV JAVA_HOME=${JAVA_HOME}

COPY --from=jdk-core $JAVA_HOME $JAVA_HOME

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand All @@ -47,7 +54,8 @@ RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tl
Remove-Item GitLfs.zip -Force ; `
& C:\mingit\cmd\git.exe lfs install ; `
$CurrentPath = (Get-Itemproperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path).Path ; `
$NewPath = $CurrentPath + ';C:\mingit\cmd' ; `
# Add git and java in PATH
$NewPath = $CurrentPath + $(';{0}\bin;C:\mingit\cmd' -f $env:JAVA_HOME) ; `
Set-ItemProperty -path 'hklm:\system\currentcontrolset\control\session manager\environment' -Name Path -Value $NewPath

ARG user=jenkins
Expand Down

0 comments on commit 8fdc902

Please sign in to comment.