oneclick / rubyinstaller2

MSYS2 based RubyInstaller for Windows
https://rubyinstaller.org
BSD 3-Clause "New" or "Revised" License
647 stars 248 forks source link

'ridk install' not working in windows docker container #164

Open LudwigK84 opened 4 years ago

LudwigK84 commented 4 years ago

I was trying to run the Dockerfile from here without any modifications.

Unfortunately, the step "ridk install 1' fails:

Step 8/23 : RUN ridk install 1 ---> Running in cfa2819aa442

sh -lc true Download http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20180531.exe to C:\Users\ContainerAdministrator\AppData\Local\Temp/msys2-x86_64-20180531.exe Downloading msys2-x86_64-20180531.exe ( 96%) OK Run the MSYS2 installer ... C:\Users\ContainerAdministrator\AppData\Local\Temp/msys2-x86_64-20180531.exe Failed C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/components/01_msys2.rb:56:in execute': MSYS2 installer failed (RuntimeError) from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:194:inblock in invoke_with_call_chain' from C:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in mon_synchronize' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:187:ininvoke_with_call_chain' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/task.rb:180:in invoke' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:152:ininvoke_task' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in block (2 levels) in top_level' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:ineach' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:108:in block in top_level' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:117:inrun_with_threads' from C:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/rake-12.0.0/lib/rake/application.rb:102:in top_level' from C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/components_installer.rb:34:ininstall' from C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/ridk.rb:99:in install' from C:/Ruby24-x64/lib/ruby/site_ruby/2.4.0/ruby_installer/runtime/ridk.rb:14:inrun!' from C:/Ruby24-x64/bin/ridk.cmd:39:in `

' Downloading msys2-x86_64-20180531.exe (100%) Verify integrity of msys2-x86_64-20180531.exe ...The command 'cmd /S /C ridk install 1' returned a non-zero code: 1

Apparently the MSYS2 installer-exe fails, but I have no idea why. Changing the ruby versions to a newer one in the Dockerfile does not help.

I'm using Docker version 19.03.5 on Windows 10.

larskanis commented 4 years ago

I built a Dockerfile that installs RubyInstaller plus Devkit. It might be helpful for you: https://github.com/oneclick/rubyinstaller2/blob/master/docker/Dockerfile

My intension was to reliably built RubyInstaller per docker. This initially worked well, but I had to realize that docker on Windows is unreliable. Although I have a lot of experience with docker on Linux, I got all kinds of errors and stability issues when running builds repeatedly or in parallel.

Regarding MSYS2, the installer need a graphical desktop. So you either habe to use the RubyInstaller bundled MSYS2 or the tar file instead: http://repo.msys2.org/distrib/

LudwigK84 commented 4 years ago

Thank you for your quick reply. I think you missed the link i posted, I was referring to the same Dockerfile you created which I couldn't get running on my machine due to the error during "ridk install 1" as described above. I'am just wondering why it does not work for me. Did you use a different docker version maybe?

EDIT: Following your advice I got it working by replacing "RUN ridk install 1" with these 5 instructions:

RUN powershell \ [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ Invoke-WebRequest https://www.7-zip.org/a/7z1900-x64.exe -Outfile 7zinstaller.exe RUN 7zinstaller.exe /S /D="C:\Program Files\7-Zip" RUN setx path "%path%;C:\Program Files\7-Zip" ADD http://repo.msys2.org/distrib/msys2-x86_64-latest.tar.xz / RUN 7z x "msys2-x86_64-latest.tar.xz" -so | 7z x -aoa -si -ttar

I don't know if downloading, installing and using 7z is a little bit of overhead, but unfortunately ADD from an url does not unpack the tar.xz file.

DryreL commented 2 years ago

Same problem here. I'm really getting sick of it. Tried to reinstall 5 times, try to open it via administrator, msysc2 etc.. none of them worked