1 # DESCRIPTION: Ruby 2.5.6 container
2 # AUTHOR: Ricardson Williams <ricardsonwilliams@gmail.com.br>
4 # Build Ruby 2.5.6 based on Amazon Linux 2 LTS (https://aws.amazon.com/amazon-linux-2/)
7 # # Download Dockerfile
8 # wget https://raw.githubusercontent.com/ricardson/dockerfiles/master/ruby-2.5.6/Dockerfile
11 # docker build -t ruby-2.5.6-amazonlinux .
14 # docker run -it ruby-2.5.6-amazonlinux
20 ENV RUBY_VERSION 2.5.6
21 ENV RUBYGEMS_VERSION 3.0.3
22 ENV BUNDLER_VERSION 2.0.2
25 mkdir -p /usr/local/etc \
27 echo 'install: --no-document'; \
28 echo 'update: --no-document'; \
29 } >> /usr/local/etc/gemrc
32 yum -y groupinstall 'Development Tools' \
44 && wget https://cache.ruby-lang.org/pub/ruby/$RUBY_MAJOR/ruby-$RUBY_VERSION.tar.gz \
45 && tar xzf ruby-$RUBY_VERSION.tar.gz -C /usr/src \
46 && cd /usr/src/ruby-$RUBY_VERSION \
47 && CFLAGS="-O3 -fPIC -fno-strict-aliasing" ./configure --disable-install-doc --enable-shared --enable-pthread \
51 && rm -rf /usr/src/ruby-$RUBY_VERSION \
52 && rm -rf /ruby-$RUBY_VERSION.tar.gz \
53 && gem update --system "$RUBYGEMS_VERSION" \
54 && gem install bundler --version "$BUNDLER_VERSION" --force \
57 ENV GEM_HOME /usr/local/bundle
58 ENV BUNDLE_PATH="$GEM_HOME" \
59 BUNDLE_BIN="$GEM_HOME/bin" \
60 BUNDLE_SILENCE_ROOT_WARNING=1 \
61 BUNDLE_APP_CONFIG="$GEM_HOME"
62 ENV PATH $BUNDLE_BIN:$PATH
65 mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
66 && chmod 777 "$GEM_HOME" "$BUNDLE_BIN"
74 RUBYGEMS_VERSION 3.0.3 \
77 ENV GEM_HOME /usr/local/bundle \
78 BUNDLE_PATH="$GEM_HOME" \
79 BUNDLE_BIN="$GEM_HOME/bin" \
80 BUNDLE_SILENCE_ROOT_WARNING=1 \
81 BUNDLE_APP_CONFIG="$GEM_HOME" \
82 PATH $BUNDLE_BIN:$PATH
85 mkdir -p "$GEM_HOME" "$BUNDLE_BIN" \
86 && chmod 777 "$GEM_HOME" "$BUNDLE_BIN" \
87 && yum -y install libyaml hostname \
89 && rm -rf /usr/share/doc/* \
90 && rm -rf /usr/share/info/* \
91 && rm -rf rm -rf /var/cache/yum/* \
92 && cp /etc/skel/.bashrc /root/
94 COPY --from=0 /usr/local/ /usr/local/