Skip to content

Instantly share code, notes, and snippets.

@gullitmiranda
Created April 27, 2015 18:38
Show Gist options
  • Save gullitmiranda/d7b0cb4987c9da9afc07 to your computer and use it in GitHub Desktop.
Save gullitmiranda/d7b0cb4987c9da9afc07 to your computer and use it in GitHub Desktop.

Revisions

  1. gullitmiranda created this gist Apr 27, 2015.
    49 changes: 49 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    # The container includes:
    #
    # azukiapp/ruby:
    # * MRI Ruby 2.1.4
    # * Bundler
    # * Image Magick
    #

    FROM azukiapp/node
    MAINTAINER Azuki <[email protected]>

    ENV RUBY_MAJOR 2.1
    ENV RUBY_VERSION 2.1.2

    # Set $PATH so that non-login shells will see the Ruby binaries
    ENV PATH $PATH:/opt/rubies/ruby-$RUBY_VERSION/bin

    # Install MRI Ruby $RUBY_VERSION
    RUN curl -O http://ftp.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz && \
    tar -zxvf ruby-$RUBY_VERSION.tar.gz && \
    cd ruby-$RUBY_VERSION && \
    ./configure --disable-install-doc && \
    make && \
    make install && \
    cd .. && \
    rm -r ruby-$RUBY_VERSION ruby-$RUBY_VERSION.tar.gz && \
    echo 'gem: --no-document' > /usr/local/etc/gemrc

    # ==============================================================================
    # Rubygems and Bundler
    # ==============================================================================

    ENV RUBYGEMS_MAJOR 2.3
    ENV RUBYGEMS_VERSION 2.3.0

    # Install rubygems and bundler
    ADD http://production.cf.rubygems.org/rubygems/rubygems-$RUBYGEMS_VERSION.tgz /tmp/
    RUN cd /tmp && \
    tar -zxf /tmp/rubygems-$RUBYGEMS_VERSION.tgz && \
    cd /tmp/rubygems-$RUBYGEMS_VERSION && \
    ruby setup.rb && \
    /bin/bash -l -c 'gem install bundler --no-rdoc --no-ri' && \
    echo "gem: --no-ri --no-rdoc" > ~/.gemrc

    # Define working directory
    WORKDIR /app

    # Set bash as a default process
    CMD ["bash"]