forked from oneclick/rubyinstaller2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (41 loc) · 1.93 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
FROM microsoft/windowsservercore
# FROM microsoft/nanoserver
# Download base ruby
RUN powershell \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-2.4.6-1/rubyinstaller-devkit-2.4.6-1-x64.exe -Outfile rubyinstaller.exe
# Download git
RUN powershell \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest https://github.com/git-for-windows/git/releases/download/v2.20.1.windows.1/Git-2.20.1-64-bit.exe -Outfile git-installer.exe
# Download Inno Setup
RUN powershell \
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \
Invoke-WebRequest http://www.jrsoftware.org/download.php/is.exe -Outfile inno-setup.exe
# Install base ruby and initialize Devkit
RUN (cmd /c rubyinstaller.exe /verysilent /log=install.log) || (powershell get-content c:/install.log)
RUN powershell $env:PATH = [Environment]::GetEnvironmentVariable('PATH','Machine'); \
$env:RUBYOPT = [Environment]::GetEnvironmentVariable('RUBYOPT','Machine')
RUN ruby --version
RUN ridk install 1
# Install git
RUN cmd /c git-installer.exe /verysilent
RUN git --version
# Install Inno Setup
RUN cmd /c inno-setup.exe /verysilent /allusers
RUN powershell [Environment]::SetEnvironmentVariable('PATH', $env:PATH + ';c:/Program Files (x86)/Inno Setup 6', 'Machine')
RUN iscc --version || (exit 0)
RUN ridk enable
# pacman fails with EXDEV error after download when /var/cache/pkg is bind mounted into the container.
# Therefore mount /var/cache directory an let pacman create the pkg directory.
RUN ridk exec rm -r c:/ruby24-x64/msys64/var/cache/pacman/pkg
# Import the git repository and unpack it in /build
WORKDIR /build
COPY gitrepo .git/
RUN dir
RUN git checkout -f
# Install required rubygems
RUN gem install bundler --no-doc
RUN bundle
WORKDIR /build/docker
CMD rake