anchor.diff:      export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
       export MAKE='make V=0' && \
       rake-compiler cross-ruby VERSION=$XRUBIES HOST=<%= target %> && \
  +    rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
  +    find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
  +
  +RUN bash -c " \
  +    export CFLAGS='-s -O1 -fno-omit-frame-pointer -fno-fast-math' && \
  +    export MAKE='make V=0' && \
  +    rvm 2.7.0 do rake-compiler cross-ruby VERSION=3.0.0-preview1 HOST=<%= target %> && \
       rm -rf ~/.rake-compiler/builds ~/.rake-compiler/sources && \
       find /usr/local/rvm -type d -print0 | sudo xargs -0 chmod g+sw "
   
  
positive.code:         ruby /root/mk_i686.rb "
  <% end %>
  
  USER rvm
  
  COPY build/patches2 /home/rvm/patches/
  # Patch rake-compiler to build and install static libraries for Linux rubies
  RUN cd /usr/local/rvm/gems/ruby-2.5.7/gems/rake-compiler-1.1.0 && \
      ( git apply /home/rvm/patches/rake-compiler-1.1.0/*.patch || true )
  RUN cd /usr/local/rvm/gems/ruby-2.5.7/gems/hoe-3.20.0 && \
      ( git apply /home/rvm/patches/hoe-3.20.0/*.patch || true )
  
  
  # Patch ruby-2.7.0 for cross build
  USER root
  
negative.code: ENV BASH_ENV /etc/rubybashrc
  
  # install rubies and fix permissions on
  ENV RVM_RUBIES 2.5.7 2.7.0
  RUN bash -c " \
      export CFLAGS='-s -O3 -fno-fast-math -fPIC' && \
      for v in ${RVM_RUBIES} ; do \
          rvm install \$v --patch \$(echo ~/patches/ruby-\$v/* | tr ' ' ','); \
      done && \
      rvm cleanup all && \
  