Sign inSign up

beer5215/ubuntu_ruby

By beer5215

Updated over 4 years ago

Image
0

142

beer5215/ubuntu_ruby repository overview

ubuntu + ruby3.x

自己编译 ruby

目前两个问题

  • ssl. 自己编译,然后指定 --with-openssl-dir
wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar -zxvf openssl-1.1.1o.tar.gz && cd openssl-1.1.1o && ./config && make && make install

./configure --with-openssl-dir=/usr/local/ssl
make && make install
  • zlib 包
apt install zlib1g-dev -y

cd ext/zlib
ruby ./extconf.rb && make && make install
dockerfile
FROM ubuntu:18.04

RUN apt update && apt install -y zlib1g-dev wget openssl vim ruby-full python3 python3-pip && gem install bundler

RUN bundle config --global silence_root_warning true \
    && rm -rf /usr/local/bundle/cache \
    && chmod -R a+r /usr/local/bin/bundle

COPY install_ruby.sh .

RUN /bin/bash install_ruby.sh

VOLUME /data

CMD ["echo", "hello ruby"]

install_ruby.sh
#!/bin/bash

set -ex

cd /root

wget https://www.openssl.org/source/openssl-1.1.1o.tar.gz
tar -zxvf openssl-1.1.1o.tar.gz && cd openssl-1.1.1o && ./config && make && make install

cd /root
wget 'https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz'
tar -zxvf ruby-3.1.2.tar.gz
cd ruby-3.1.2

apt install zlib1g-dev -y
cd ext/zlib
ruby ./extconf.rb && make && make install
cd ../..

./configure --with-openssl-dir=/usr/local/ssl
make && make install

Tag summary

Content type

Image

Digest

Size

603 MB

Last updated

over 4 years ago

docker pull beer5215/ubuntu_ruby