2018-09-05 18:25:27 +02:00
|
|
|
IMAGE build
|
2018-09-05 17:41:38 +02:00
|
|
|
LAYER shared/alpine
|
|
|
|
LAYER shared/ruby
|
|
|
|
|
|
|
|
SCRIPT
|
|
|
|
# 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-09-06 21:15:43 +02:00
|
|
|
wget http://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.6.tar.xz -O - | tar xJf - -C /usr/src/ruby --strip-components=1
|
2018-09-05 17:41:38 +02:00
|
|
|
cd /usr/src/ruby
|
|
|
|
|
|
|
|
# Hackfix to suppress "Insecure world writable dir" warning
|
|
|
|
sed -ni 'p;13a #define ENABLE_PATH_CHECK 0' file.c
|
|
|
|
|
|
|
|
# Configure compilation + hackfix to detect isnan/isinf macros
|
|
|
|
autoconf
|
|
|
|
ac_cv_func_isnan=yes ac_cv_func_isinf=yes ./configure --build=x86_64-linux-musl --disable-install-doc --enable-shared
|
|
|
|
|
|
|
|
# Compile and install Ruby
|
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
|
|
|
|
cd /tmp
|
|
|
|
rm -r /usr/src/ruby
|
|
|
|
apk --no-cache del .deps
|
|
|
|
rm -rf /root/.gem
|
|
|
|
RUN
|