-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build Ruby 3.0 for old distributions
- Loading branch information
Showing
3 changed files
with
67 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
ARG os=ubuntu | ||
ARG version= | ||
ARG variant= | ||
ARG baseruby= | ||
ARG build_ruby= | ||
ARG system_ruby= | ||
ARG packages= | ||
|
||
FROM ${os}:${version}${variant} as assets | ||
|
@@ -46,7 +47,8 @@ RUN wget \ | |
-y | ||
|
||
FROM ${os}:${version}${variant} as compilers | ||
ARG baseruby | ||
ARG build_ruby | ||
ARG system_ruby | ||
ARG packages | ||
|
||
LABEL [email protected] | ||
|
@@ -59,12 +61,16 @@ COPY --from=assets /rust /rust | |
ENV RUSTUP_HOME=/rust/rustup | ||
ENV PATH=${PATH}:/rust/cargo/bin | ||
|
||
COPY build_ruby.sh /tmp | ||
RUN set -ex \ | ||
&& apt-get update \ | ||
&& apt-get install ${packages} \ | ||
libjemalloc-dev openssl libyaml-dev ruby tzdata valgrind sudo docker.io \ | ||
libjemalloc-dev openssl libyaml-dev tzdata valgrind wget ca-certificates sudo docker.io \ | ||
libreadline-dev libcapstone-dev \ | ||
&& apt-get build-dep ruby${baseruby} | ||
&& apt-get build-dep ruby${system_ruby} \ | ||
&& bash -c "if [[ -n '$system_ruby' ]]; then apt-get install 'ruby${system_ruby}'; fi" \ | ||
&& bash -c "if [[ -n '$build_ruby' ]]; then /tmp/build_ruby.sh '$build_ruby'; fi" \ | ||
&& rm /tmp/build_ruby.sh | ||
|
||
RUN adduser --disabled-password --gecos '' ci && adduser ci sudo | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
|
||
ruby_version="$1" | ||
|
||
mkdir /tmp/build_ruby | ||
trap 'rm -rf /tmp/build_ruby' EXIT | ||
cd /tmp/build_ruby | ||
|
||
wget "https://cache.ruby-lang.org/pub/ruby/${ruby_version:0:3}/ruby-${ruby_version}.tar.gz" | ||
tar xvzf "ruby-${ruby_version}.tar.gz" | ||
cd "ruby-${ruby_version}" | ||
|
||
./configure --disable-install-doc | ||
make -j | ||
make install |