diff --git a/Dockerfile b/Dockerfile index 084c300..83b6c94 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ ARG os=debian -ARG version=bullseye +ARG version=bookworm ARG variant=-slim ARG mirror=http://deb.debian.org/debian -ARG system_ruby=ruby2.7 +ARG system_ruby=ruby3.1 -# Build for 0.*, 1.0*, 1.1*, 1.8 and 1.8.5 +# Build for 0.*, 1.0*, 1.1*, 1.8.0-4, 1.8.5 and 2.0.0 FROM debian:buster-slim ENV DEBIAN_FRONTEND=noninteractive ARG mirror @@ -45,14 +45,13 @@ RUN rm -rf build/*/man build/*/share/man build/*/share/doc build/*/share/ri RUN rm -f build/*/lib/libruby-static.a RUN rm -f build/*/bin/gcc build/*/bin/cc -FROM ${os}:${version}${variant} +# Build for 1.2*, 1.3*, 1.4*, 1.6*, 1.8.6, 1.8.7, 1.9 and 2.1-3.0 +FROM debian:bullseye-slim ENV DEBIAN_FRONTEND=noninteractive ARG mirror -ARG version -ARG system_ruby RUN dpkg --add-architecture i386 \ - && echo "deb-src ${mirror} ${version} main" > /etc/apt/sources.list.d/deb-src.list \ + && echo "deb-src ${mirror} bullseye main" > /etc/apt/sources.list.d/deb-src.list \ && echo 'Dpkg::Use-Pty "0";\nquiet "2";\nAPT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99autopilot \ && echo 'Acquire::HTTP::No-Cache "True";' > /etc/apt/apt.conf.d/99no-cache \ && apt-get update \ @@ -62,9 +61,9 @@ RUN dpkg --add-architecture i386 \ bison \ rdfind \ file \ - lib${system_ruby}:amd64 \ - lib${system_ruby}:i386 \ - && apt-get build-dep ${system_ruby} \ + libruby2.7:amd64 \ + libruby2.7:i386 \ + && apt-get build-dep libruby2.7 \ && rm -rf /var/lib/apt/lists/* COPY --from=0 /build-all-ruby/ /build-all-ruby @@ -93,13 +92,50 @@ RUN rake -j ${j} all-2.6 RUN rake -j ${j} all-2.7 RUN rake -j ${j} all-3.0 -COPY versions/3.1* /all-ruby/versions/ -RUN rake -j ${j} all-3.1 +RUN rm -rf Rakefile versions/ patch/ +RUN rm -rf DIST build/*/log build/*/ruby*/ +RUN rm -rf build/*/man build/*/share/man build/*/share/doc build/*/share/ri +RUN rm -f build/*/lib/libruby-static.a +RUN rm -f build/*/bin/gcc build/*/bin/cc -COPY versions/3.2* /all-ruby/versions/ -RUN rake -j ${j} all-3.2 +FROM ${os}:${version}${variant} +ENV DEBIAN_FRONTEND=noninteractive +ARG mirror +ARG version +ARG system_ruby -COPY versions/3.3* /all-ruby/versions/ +RUN dpkg --add-architecture i386 \ + && echo "deb-src ${mirror} ${version} main" > /etc/apt/sources.list.d/deb-src.list \ + && echo 'Dpkg::Use-Pty "0";\nquiet "2";\nAPT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99autopilot \ + && echo 'Acquire::HTTP::No-Cache "True";' > /etc/apt/apt.conf.d/99no-cache \ + && apt-get update \ + && apt-get install \ + build-essential \ + gcc-multilib \ + bison \ + rdfind \ + file \ + lib${system_ruby}:amd64 \ + lib${system_ruby}:i386 \ + && apt-get build-dep ${system_ruby} \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=1 /build-all-ruby/ /build-all-ruby +COPY --from=1 /all-ruby/ /all-ruby + +WORKDIR /all-ruby + +COPY Rakefile /all-ruby/ +COPY lib/ruby_version.rb /all-ruby/lib/ +COPY patch /all-ruby/patch/ +RUN rake setup_build + +# rake -j interpret non-numeric argument as number of CPUs plus 3. +ARG j=numcpu_plus_alpha + +COPY versions/3.1* versions/3.2* versions/3.3* /all-ruby/versions/ +RUN rake -j ${j} all-3.1 +RUN rake -j ${j} all-3.2 RUN rake -j ${j} all-3.3 COPY lib/* /all-ruby/lib/ @@ -129,24 +165,28 @@ RUN dpkg --add-architecture i386 \ && apt-get update \ && apt-get install \ libc6:i386 \ - libffi7:i386 \ + libffi8:i386 \ libgcc1:i386 \ libgdbm6:i386 \ libncurses5:i386 \ libreadline8:i386 \ - libssl1.1:i386 \ + libssl3:i386 \ zlib1g:i386 \ - libffi7:amd64 \ + libffi8:amd64 \ libgdbm6:amd64 \ libncurses5:amd64 \ libreadline8:amd64 \ - libssl1.1:amd64 \ + libssl3:amd64 \ zlib1g:amd64 \ gcc \ ${system_ruby} \ && rm -rf /var/lib/apt/lists/* -COPY --from=1 /build-all-ruby/ /build-all-ruby -COPY --from=1 /all-ruby/ /all-ruby +COPY --from=2 /build-all-ruby/ /build-all-ruby +COPY --from=2 /all-ruby/ /all-ruby + +# for Ruby 0.x and 1.1x +COPY --from=2 /lib/i386-linux-gnu/libcrypt.so.1.1.0 /lib/i386-linux-gnu/libcrypt.so.1.1.0 +RUN cd /lib/i386-linux-gnu && ln -s libcrypt.so.1.1.0 libcrypt.so.1 WORKDIR /all-ruby