Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockerImage for Ruby 3.4.2 on Windows #33

Merged
merged 1 commit into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .expeditor/build-windows-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ steps:
- id: build-and-push-on-windows-2019-server-rubydistros-dockerhub
label: ":docker::windows: build-and-push-rubydistros-dockerhub"
commands:
- "docker build . -f 3.3/windows/2019/Dockerfile -t windows-2019:3.3"
- "docker tag windows-2019:3.3 docker.io/rubydistros/windows-2019:3.3"
- "docker tag windows-2019:3.3 docker.io/rubydistros/windows-2019:latest"
- "docker push docker.io/rubydistros/windows-2019:3.3"
- "docker build . -f 3.4/windows/2019/Dockerfile -t windows-2019:3.4"
- "docker tag windows-2019:3.4 docker.io/rubydistros/windows-2019:3.4"
- "docker tag windows-2019:3.4 docker.io/rubydistros/windows-2019:latest"
- "docker push docker.io/rubydistros/windows-2019:3.4"
- "docker push docker.io/rubydistros/windows-2019:latest"
agents:
queue: docker-windows-2019
plugins:
- docker-login#v2.1.0:
username: expeditor
username: expeditor
51 changes: 51 additions & 0 deletions 3.4/windows/2019/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM mcr.microsoft.com/windows/servercore:ltsc2019

ENV BUNDLE_SILENCE_ROOT_WARNING=true \
GIT_DISCOVERY_ACROSS_FILESYSTEM=true

# When launched by user, default to PowerShell if no other command specified.
CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]

# latest choco via PowerShell on windows2019 requires .NET, Download and install .NET Framework 4.8
FROM mcr.microsoft.com/dotnet/framework/sdk:4.8-windowsservercore-ltsc2019
ADD https://go.microsoft.com/fwlink/?linkid=863265 /ndp472-kb4054530-x86-x64-allos-enu.exe
RUN C:\ndp472-kb4054530-x86-x64-allos-enu.exe /quiet /install

# Install Chocolatey (and essentials)
ADD https://chocolatey.org/install.ps1 /chocolatey_install.ps1
RUN powershell -File C:\chocolatey_install.ps1
RUN C:\ProgramData\Chocolatey\bin\refreshenv -and \
choco feature enable -n=allowGlobalConfirmation -and \
choco config set cacheLocation C:\chococache -and \
choco upgrade chocolatey -and \
rmdir /q /s C:\chococache -and \
del C:\chocolatey_install.ps1 -and \
Write-Output "Chocolatey install complete -- closing out layer"
#install git
RUN choco install git.install -y
#from the versions which are >2.35 requires Strict repository ownership checks hence we are doing this step
#can found more on here https://github.blog/2022-04-18-highlights-from-git-2-36/#stricter-repository-ownership-checks
RUN git config --system --add safe.directory '*'
RUN git --version

# Install Ruby + Devkit
RUN $ErrorActionPreference = 'Stop'; \
Write-Output 'Downloading Ruby + DevKit'; \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
(New-Object System.Net.WebClient).DownloadFile('https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.4.2-1/rubyinstaller-3.4.2-1-x64.exe', 'c:\\rubyinstaller-devkit-3.4.2-1-x64.exe'); \
Write-Output 'Installing Ruby + DevKit'; \
Start-Process c:\rubyinstaller-devkit-3.4.2-1-x64.exe -ArgumentList '/verysilent /allusers /dir=C:\\ruby33' -Wait ; \
Write-Output 'Cleaning up installation'; \
Remove-Item c:\rubyinstaller-devkit-3.4.2-1-x64.exe -Force; \
Write-Output 'Closing out the layer';

# Download MSYS2 dev kit, extract it and add to the PATH variable

RUN powershell -Command (New-Object System.Net.WebClient).DownloadFile('https://github.com/msys2/msys2-installer/releases/download/2025-02-21/msys2-x86_64-20250221.exe', 'c:\\msys2-x86_64-20250221.exe'); \
.\msys2-x86_64-20250221.exe in --confirm-command --accept-messages --root C:\msys2 ; \
[Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';C:\msys2', [EnvironmentVariableTarget]::Machine); \
Remove-Item 'C:\msys2-x86_64-20250221.exe'

#Install MSYS2 and MINGW development toolchain and enable it
RUN ridk install 3
RUN ridk enable