CentOS7にRuby 1.8.7 をインストールする(opensslなし)

  • 1
    いいね
  • 0
    コメント
Dockerfile
FROM centos:7

ENV BUILDROOT="/root/rpmbuild"

RUN yum install -y -q gcc make bzip2 file which && yum clean all

# fpm ---------------------------------------------------------------
RUN yum -y install ruby ruby-devel ruby-libs rubygems rpm-build \
 && gem install fpm --no-rdoc --no-ri

# ruby---------------------------------------------------------------
WORKDIR $BUILDROOT/SOURCES/
# http://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p374.tar.bz2
COPY ruby-1.8.7-p374.tar.bz2 .
RUN tar xf ruby-1.8.7-p374.tar.bz2
WORKDIR $BUILDROOT/SOURCES/ruby-1.8.7-p374
# https://www.ruby-forum.com/topic/142608
RUN yum install -y -q tk-devel tclx

#RUN yum remove -y openssl-devel

RUN ./configure --prefix=/opt/ruby --enable-pthread \
 && make -s \
 && make test \
 && make install

RUN fpm -s dir \
  -v 1.8.7_p374 \
  -t rpm \
  -n opt-ruby \
  -p opt-ruby-1.8.7-p374.el7.x86_64.rpm \
  -C /opt/ruby \
  -a x86_64 \
  /opt/ruby

configureを確認

ruby -r rbconfig -e 'puts RbConfig::CONFIG["configure_args"]'