2020-10-22 20:42:45 +02:00
|
|
|
IMAGE alpine3.12-ruby2.6_2.6.6-201021
|
|
|
|
FROM alpine3.12_3.12.1-201021
|
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
|
2019-11-17 14:53:05 +01:00
|
|
|
apk --no-cache add gdbm zlib
|
2018-09-05 17:41:38 +02:00
|
|
|
|
|
|
|
# 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
|
2020-10-04 23:15:31 +02:00
|
|
|
wget http://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.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
|
2020-10-24 22:08:12 +02:00
|
|
|
# Hackfix thread stack size
|
|
|
|
# https://github.com/docker-library/ruby/issues/196, https://bugs.ruby-lang.org/issues/14387
|
|
|
|
wget 'https://bugs.ruby-lang.org/attachments/download/7081/0001-thread_pthread.c-make-get_main_stack-portable-on-lin.patch' -O thread-stack-fix.patch
|
|
|
|
patch -p1 -i thread-stack-fix.patch
|
2018-12-05 14:07:45 +01:00
|
|
|
autoconf
|
2020-10-24 22:08:12 +02:00
|
|
|
# Hackfix isnan/isinf macros
|
|
|
|
export ac_cv_func_isnan=yes ac_cv_func_isinf=yes
|
2018-12-05 14:07:45 +01:00
|
|
|
./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
|