|
|
|
FROM ubuntu:14.04
|
|
|
|
|
|
|
|
RUN apt-get -y update && \
|
|
|
|
apt-get install -y curl git-core mingw-w64 xz-utils build-essential wget unzip
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/mingw && \
|
|
|
|
curl -SL http://downloads.sourceforge.net/mingw-w64/i686-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
|
|
|
|
tar -xJC /opt/mingw && \
|
|
|
|
echo "export PATH=\$PATH:/opt/mingw/mingw32/bin" >> /etc/rubybashrc
|
|
|
|
|
|
|
|
RUN mkdir -p /opt/mingw && \
|
|
|
|
curl -SL http://downloads.sourceforge.net/mingw-w64/x86_64-w64-mingw32-gcc-4.7.2-release-linux64_rubenvb.tar.xz | \
|
|
|
|
tar -xJC /opt/mingw && \
|
|
|
|
echo "export PATH=\$PATH:/opt/mingw/mingw64/bin" >> /etc/rubybashrc
|
|
|
|
|
|
|
|
# Add "rvm" as system group, to avoid conflicts with host GIDs typically starting with 1000
|
|
|
|
RUN groupadd -r rvm && useradd -r -g rvm -G sudo -p "" --create-home rvm && \
|
|
|
|
echo "source /etc/profile.d/rvm.sh" >> /etc/rubybashrc
|
|
|
|
USER rvm
|
|
|
|
|
|
|
|
# install rvm, RVM 1.26.0+ has signed releases, source rvm for usage outside of package scripts
|
|
|
|
RUN gpg --keyserver hkp://keys.gnupg.net --recv-keys D39DC0E3 && \
|
|
|
|
(curl -L http://get.rvm.io | sudo bash -s stable) && \
|
|
|
|
bash -c " \
|
|
|
|
source /etc/rubybashrc && \
|
|
|
|
rvmsudo rvm cleanup all "
|
|
|
|
|
|
|
|
# Regenerate the following using build.sh if the build folder changes.
|
|
|
|
RUN echo \
|
|
|
|
H4sIAByxrVYAA+1ae1PbSBLPv6dP0SeoxYAlWX7IkEAuBBziqgRSPJK7SnLasTSydJYl3cwIQwH7\
|
|
|
|
2a9nJAMmIYTb4K3s6ldlaTSP7p5X93R7BnkU+9aTR0UD0e125Nvudhrq2+621LvEE7vp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pUqFChQoUKFSpUqFChQoWfCv8DRAWcgwBQAAA=\
|
|
|
|
| base64 -d | tar xzC /tmp
|
|
|
|
|
|
|
|
# Import patch files for ruby and gems
|
|
|
|
RUN cp -r /tmp/build/patches /home/rvm/patches/
|
|
|
|
ENV BASH_ENV /etc/rubybashrc
|
|
|
|
|
|
|
|
# install rubies and fix permissions on
|
|
|
|
RUN bash -c " \
|
|
|
|
export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
|
|
|
|
for v in 2.3.0 ; do \
|
|
|
|
rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
|
|
|
|
done && \
|
|
|
|
rvm cleanup all && \
|
|
|
|
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
|
|
|
|
|
|
|
# Install rake-compiler and typical gems in all Rubies
|
|
|
|
# do not generate documentation for gems
|
|
|
|
RUN echo "gem: --no-ri --no-rdoc" >> ~/.gemrc && \
|
|
|
|
bash -c " \
|
|
|
|
rvm all do gem install bundler rake-compiler hoe mini_portile rubygems-tasks json && \
|
|
|
|
rvm 2.3.0 do gem install mini_portile2 && \
|
|
|
|
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
|
|
|
|
|
|
|
# Install rake-compiler's cross rubies in global dir instead of /root
|
|
|
|
RUN sudo mkdir -p /usr/local/rake-compiler && \
|
|
|
|
sudo chown rvm.rvm /usr/local/rake-compiler && \
|
|
|
|
ln -s /usr/local/rake-compiler ~/.rake-compiler
|
|
|
|
|
|
|
|
# Patch rake-compiler to avoid build of ruby extensions
|
|
|
|
RUN cd /usr/local/rvm/gems/ruby-2.3.0/gems/rake-compiler-0.9.5 && patch -p1 < /home/rvm/patches/rake-compiler-0.9.5/without-exts.diff ; \
|
|
|
|
true
|
|
|
|
|
|
|
|
RUN bash -c "rvm use 2.3.0 --default && \
|
|
|
|
export MAKE=\"make -j`nproc`\" CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.3.0 HOST=i686-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.3.0 HOST=x86_64-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.2.2 HOST=i686-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.2.2 HOST=x86_64-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.1.6 HOST=i686-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.1.6 HOST=x86_64-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=i686-w64-mingw32 && \
|
|
|
|
rake-compiler cross-ruby VERSION=2.0.0-p645 HOST=x86_64-w64-mingw32 && \
|
|
|
|
rm -rf ~/.rake-compiler/tmp/builds ~/.rake-compiler/sources && \
|
|
|
|
find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
|
|
|
|
|
|
|
|
RUN bash -c " \
|
|
|
|
rvm alias create 2.3 2.3.0 "
|
|
|
|
|
|
|
|
USER root
|
|
|
|
|
|
|
|
# Fix paths in rake-compiler/config.yml and add rvm and mingw-tools to the global bashrc
|
|
|
|
RUN sed -i -- "s:/root/.rake-compiler:/usr/local/rake-compiler:g" /usr/local/rake-compiler/config.yml && \
|
|
|
|
echo "source /etc/profile.d/rvm.sh" >> /etc/bash.bashrc && \
|
|
|
|
echo "export PATH=\$PATH:/opt/mingw/mingw32/bin" >> /etc/bash.bashrc && \
|
|
|
|
echo "export PATH=\$PATH:/opt/mingw/mingw64/bin" >> /etc/bash.bashrc
|
|
|
|
|
|
|
|
# Install wrappers for strip commands as a workaround for "Protocol error" in boot2docker.
|
|
|
|
RUN cp /tmp/build/strip_wrapper /root/
|
|
|
|
RUN mv /opt/mingw/mingw32/bin/i686-w64-mingw32-strip /opt/mingw/mingw32/bin/i686-w64-mingw32-strip.bin && \
|
|
|
|
mv /opt/mingw/mingw64/bin/x86_64-w64-mingw32-strip /opt/mingw/mingw64/bin/x86_64-w64-mingw32-strip.bin && \
|
|
|
|
mv /usr/bin/i686-w64-mingw32-strip /usr/bin/i686-w64-mingw32-strip.bin && \
|
|
|
|
mv /usr/bin/x86_64-w64-mingw32-strip /usr/bin/x86_64-w64-mingw32-strip.bin && \
|
|
|
|
ln /root/strip_wrapper /opt/mingw/mingw32/bin/i686-w64-mingw32-strip && \
|
|
|
|
ln /root/strip_wrapper /opt/mingw/mingw64/bin/x86_64-w64-mingw32-strip && \
|
|
|
|
ln /root/strip_wrapper /usr/bin/i686-w64-mingw32-strip && \
|
|
|
|
ln /root/strip_wrapper /usr/bin/x86_64-w64-mingw32-strip
|
|
|
|
|
|
|
|
RUN find / -name rbconfig.rb | while read f ; do sed -i 's/0x0501/0x0600/' $f ; done
|
|
|
|
RUN find / -name win32.h | while read f ; do sed -i 's/gettimeofday/rb_gettimeofday/' $f ; done
|
|
|
|
RUN sed -i 's/defined.__MINGW64__.$/1/' /usr/local/rake-compiler/ruby/i686-w64-mingw32/ruby-2.0.0-p645/include/ruby-2.0.0/ruby/win32.h
|
|
|
|
RUN find / -name libwinpthread.dll.a | while read f ; do rm $f ; done
|
|
|
|
RUN find / -name libwinpthread-1.dll | while read f ; do rm $f ; done
|
|
|
|
RUN find / -name *msvcrt-ruby*.dll.a | while read f ; do n=`echo $f | sed s/.dll//` ; mv $f $n ; done
|
|
|
|
|
|
|
|
# Install SIGINT forwarder
|
|
|
|
RUN cp /tmp/build/sigfw.c /root/
|
|
|
|
RUN gcc $HOME/sigfw.c -o /usr/local/bin/sigfw
|
|
|
|
|
|
|
|
# Install user mapper
|
|
|
|
RUN cp /tmp/build/runas /usr/local/bin/
|
|
|
|
|
|
|
|
# Install sudoers configuration
|
|
|
|
RUN cp /tmp/build/sudoers /etc/sudoers.d/rake-compiler-dock
|
|
|
|
|
|
|
|
ENV RUBY_CC_VERSION 2.3.0:2.2.2:2.1.6:2.0.0
|
|
|
|
|
|
|
|
CMD bash
|