Skip to content

Instantly share code, notes, and snippets.

@mrstebo
Created December 20, 2016 08:59
Show Gist options
  • Select an option

  • Save mrstebo/3031daf8a0ddda3967e22042b4f39911 to your computer and use it in GitHub Desktop.

Select an option

Save mrstebo/3031daf8a0ddda3967e22042b4f39911 to your computer and use it in GitHub Desktop.
Dockerfile for installing Ruby on Windows Server Core
FROM microsoft/windowsservercore
ENV DEVKITFILENAME DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
ENV APPDIR c:\\app
ENV DEVKITDIR devkit
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest -Method Get -Uri http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.3.3-x64.exe -OutFile c:\rubyinstaller-2.3.3-x64.exe; \
Start-Process c:\rubyinstaller-2.3.3-x64.exe -ArgumentList '/verysilent' -Wait; \
Remove-Item c:\rubyinstaller-2.3.3-x64.exe -Force;
RUN powershell -command "wget 'http://dl.bintray.com/oneclick/rubyinstaller/%DEVKITFILENAME%' -outfile %DEVKITFILENAME%";
RUN powershell -command $env:chocolateyUseWindowsCompression = 'false'; \
"iwr https://chocolatey.org/install.ps1 -UseBasicParsing | iex";
RUN SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin;C:\Ruby23-x64\bin
RUN choco install 7zip -y
RUN powershell -command "& '%PROGRAMFILES%\\7-zip\\7z' e -r -y -o%DEVKITDIR% %DEVKITFILENAME%"
RUN powershell -command "cd %DEVKITDIR%; C:\\Ruby23-x64\\bin\\ruby dk.rb init"
RUN powershell -command "cd %DEVKITDIR%; add-content config.yml '- C:\\Ruby23-x64'"
RUN powershell -command "cd %DEVKITDIR%; C:\\Ruby23-x64\\bin\\ruby dk.rb install"
RUN mkdir %APPDIR%
WORKDIR /app
COPY Gemfile* /app/
RUN C:\Ruby23-x64\bin\gem install bundler --no-ri --no-rdoc
RUN C:\Ruby23-x64\bin\bundle install --without development test
COPY . /app
@mrstebo
Copy link
Author

mrstebo commented Dec 20, 2016

bundle install seems to fail. Seems to be an issue with SSL.

Gem::RemoteFetcher::FetchError: Errno::ECONNRESET: An existing connection was forcibly closed by the remote host. 
- SSL_connect (https://rubygems.org/gems/nio4r-1.2.1.gem)
An error occurred while installing nio4r (1.2.1), and Bundler cannot continue.
Make sure that `gem install nio4r -v '1.2.1'` succeeds before bundling.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment