Skip to content

Instantly share code, notes, and snippets.

@EriksonBahr
Created September 3, 2018 21:30
Show Gist options
  • Save EriksonBahr/927e21bfd91191cdc2c1b1b3ba96a60a to your computer and use it in GitHub Desktop.
Save EriksonBahr/927e21bfd91191cdc2c1b1b3ba96a60a to your computer and use it in GitHub Desktop.
FROM ebahr/windowsservercore-netfx3:10.0.14393.2248
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
ENV tempFolder C:\\temp
ENV hklmCodeGearRegistries hklm_codegear.reg
ENV hkcuCodeGearRegistries hkcu_codegear.reg
#install msbuild 15
RUN Invoke-WebRequest "https://aka.ms/vs/15/release/vs_BuildTools.exe" -OutFile vs_BuildTools.exe -UseBasicParsing ; \
Start-Process -FilePath 'vs_BuildTools.exe' -ArgumentList '--quiet', '--norestart', '--locale en-US' -Wait ; \
Remove-Item .\vs_BuildTools.exe ; \
Remove-Item -Force -Recurse 'C:\Program Files (x86)\Microsoft Visual Studio\Installer'
#copy binary and registries
COPY ["bin/delphiFiles/pfCodeGear", "C:/Program Files (x86)/CodeGear"]
COPY bin/delphiFiles/adCodeGear C:/Users/ContainerAdministrator/AppData/Roaming/CodeGear
COPY registries/delphiRegistries/$hklmCodeGearRegistries $tempFolder\\$hklmCodeGearRegistries
COPY registries/delphiRegistries/$hkcuCodeGearRegistries $tempFolder\\$hkcuCodeGearRegistries
#apply IDE registries
RUN regedit /s $tempFolder\\$hklmCodeGearRegistries
RUN regedit /s $tempFolder\\$hkcuCodeGearRegistries
#set environment variables
RUN setx /M PATH $($Env:PATH + ';' + ${Env:ProgramFiles(x86)} + '\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin' + ';C:\Another\Component\Path')
RUN setx /M BDS 'C:\Program Files (x86)\CodeGear\RAD Studio\6.0'
RUN setx /M DXVCL 'C:\MySuperComponent\Path'
#clean image
RUN Remove-Item -Recurse -Force $env:tempFolder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment