2018-09-05 18:25:27 +02:00
|
|
|
IMAGE build
|
2019-02-26 20:24:02 +01:00
|
|
|
LAYER shared/alpine3.8
|
|
|
|
LAYER shared/alpine3.8-ruby2.4
|
2018-09-05 17:41:38 +02:00
|
|
|
|
2018-09-12 16:08:10 +02:00
|
|
|
RUN EOF
|
2018-09-05 17:41:38 +02:00
|
|
|
# Install Ruby runtime dependencies
|
|
|
|
apk --no-cache add gdbm libressl readline zlib
|
|
|
|
|
|
|
|
# Install Ruby build dependencies
|
|
|
|
apk --no-cache add --virtual .deps build-base autoconf gdbm-dev libressl-dev linux-headers readline-dev zlib-dev
|
|
|
|
|
|
|
|
# Download and unpack Ruby
|
|
|
|
mkdir -p /usr/src/ruby
|
2018-12-05 14:07:45 +01:00
|
|
|
wget http://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.5.tar.xz -O - | tar xJf - -C /usr/src/ruby --strip-components=1
|
2018-09-05 17:41:38 +02:00
|
|
|
|
|
|
|
# Compile and install Ruby
|
2018-12-05 14:07:45 +01:00
|
|
|
cd /usr/src/ruby
|
|
|
|
autoconf
|
|
|
|
./configure --build=x86_64-linux-musl --disable-install-doc --enable-shared
|
2018-09-12 14:19:36 +02:00
|
|
|
make -j $(getconf _NPROCESSORS_ONLN)
|
2018-09-05 17:41:38 +02:00
|
|
|
make install
|
|
|
|
|
|
|
|
# Install RubyGems and Bundler
|
|
|
|
mkdir -p /usr/local/etc
|
|
|
|
echo -e 'install: --no-document\nupdate: --no-document' >/usr/local/etc/gemrc
|
|
|
|
gem update --system
|
|
|
|
|
|
|
|
# Cleanup
|
|
|
|
apk --no-cache del .deps
|
2018-12-05 14:07:45 +01:00
|
|
|
cd /root
|
|
|
|
rm -r /usr/src/ruby
|
2018-09-05 17:41:38 +02:00
|
|
|
rm -rf /root/.gem
|
2018-09-12 16:08:10 +02:00
|
|
|
EOF
|