Skip to content

Commit f5b30b3

Browse files
committed
Split legacy Ruby builds into separate stages
1 parent ccc2b6d commit f5b30b3

3 files changed

Lines changed: 26 additions & 12 deletions

File tree

.github/workflows/build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ jobs:
1414
matrix:
1515
target:
1616
- ruby-0.x-2.0
17-
- ruby-1.2-1.8.7
17+
- ruby-1.2-1.6
18+
- ruby-1.8.6-1.8.7
1819
- ruby-1.9
1920
- ruby-2.1
2021
- ruby-2.2

Dockerfile

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,16 @@ FROM debian:bullseye-slim AS builder-bullseye
6262
ENV DEBIAN_FRONTEND=noninteractive
6363
ARG mirror
6464

65-
RUN dpkg --add-architecture i386 \
66-
&& echo "deb-src ${mirror} bullseye main" > /etc/apt/sources.list.d/deb-src.list \
65+
RUN echo "deb-src ${mirror} bullseye main" > /etc/apt/sources.list.d/deb-src.list \
6766
&& echo 'Dpkg::Use-Pty "0";\nquiet "2";\nAPT::Install-Recommends "0";' > /etc/apt/apt.conf.d/99autopilot \
6867
&& echo 'Acquire::HTTP::No-Cache "True";' > /etc/apt/apt.conf.d/99no-cache \
6968
&& apt-get update \
7069
&& apt-get install \
7170
build-essential \
72-
gcc-multilib \
7371
bison \
7472
rdfind \
7573
file \
7674
libruby2.7:amd64 \
77-
libruby2.7:i386 \
7875
&& apt-get build-dep ruby2.7 \
7976
&& rm -rf /var/lib/apt/lists/*
8077

@@ -86,13 +83,27 @@ COPY patch /all-ruby/patch/
8683
RUN rake setup_build
8784

8885
# =============================================================================
89-
# Ruby 1.2-1.8.7
86+
# Ruby 1.2-1.6 on Debian Buster (needs i386 for 32-bit builds)
87+
# =============================================================================
88+
FROM builder-buster AS ruby-1.2-1.6
89+
ARG j=numcpu_plus_alpha
90+
91+
COPY versions/1.2* versions/1.3* versions/1.4* versions/1.6* /all-ruby/versions/
92+
RUN rake -j ${j} all-1.2 all-1.3 all-1.4 all-1.6
93+
94+
RUN rm -rf Rakefile versions/ patch/ DIST build/*/log build/*/ruby*/ \
95+
build/*/man build/*/share/man build/*/share/doc build/*/share/ri && \
96+
rm -f build/*/lib/libruby-static.a build/*/bin/gcc build/*/bin/cc
97+
RUN find /build-all-ruby -type f \( -name ruby -o -name '*.so' \) -exec sh -c 'file $1 | grep -q "not stripped"' - '{}' \; -print0 | xargs -0 strip
98+
99+
# =============================================================================
100+
# Ruby 1.8.6-1.8.7
90101
# =============================================================================
91-
FROM builder-bullseye AS ruby-1.2-1.8.7
102+
FROM builder-bullseye AS ruby-1.8.6-1.8.7
92103
ARG j=numcpu_plus_alpha
93104

94-
COPY versions/1.2* versions/1.3* versions/1.4* versions/1.6* versions/1.8.6* versions/1.8.7* /all-ruby/versions/
95-
RUN rake -j ${j} all-1.2 all-1.3 all-1.4 all-1.6 all-1.8.6 all-1.8.7
105+
COPY versions/1.8.6* versions/1.8.7* /all-ruby/versions/
106+
RUN rake -j ${j} all-1.8.6 all-1.8.7
96107

97108
RUN rm -rf Rakefile versions/ patch/ DIST build/*/log build/*/ruby*/ \
98109
build/*/man build/*/share/man build/*/share/doc build/*/share/ri && \

Dockerfile.final

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,17 @@ ARG system_ruby=ruby3.1
1010
FROM ${os}:${version}${variant} AS ruby-0.x-2.4
1111

1212
COPY --from=docker.io/rubylang/all-ruby:ruby-0.x-2.0 /build-all-ruby/ /build-all-ruby/
13-
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.8.7 /build-all-ruby/ /build-all-ruby/
13+
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.6 /build-all-ruby/ /build-all-ruby/
14+
COPY --from=docker.io/rubylang/all-ruby:ruby-1.8.6-1.8.7 /build-all-ruby/ /build-all-ruby/
1415
COPY --from=docker.io/rubylang/all-ruby:ruby-1.9 /build-all-ruby/ /build-all-ruby/
1516
COPY --from=docker.io/rubylang/all-ruby:ruby-2.1 /build-all-ruby/ /build-all-ruby/
1617
COPY --from=docker.io/rubylang/all-ruby:ruby-2.2 /build-all-ruby/ /build-all-ruby/
1718
COPY --from=docker.io/rubylang/all-ruby:ruby-2.3 /build-all-ruby/ /build-all-ruby/
1819
COPY --from=docker.io/rubylang/all-ruby:ruby-2.4 /build-all-ruby/ /build-all-ruby/
1920

2021
COPY --from=docker.io/rubylang/all-ruby:ruby-0.x-2.0 /all-ruby/ /all-ruby/
21-
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.8.7 /all-ruby/bin/ /all-ruby/bin/
22+
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.6 /all-ruby/bin/ /all-ruby/bin/
23+
COPY --from=docker.io/rubylang/all-ruby:ruby-1.8.6-1.8.7 /all-ruby/bin/ /all-ruby/bin/
2224
COPY --from=docker.io/rubylang/all-ruby:ruby-1.9 /all-ruby/bin/ /all-ruby/bin/
2325
COPY --from=docker.io/rubylang/all-ruby:ruby-2.1 /all-ruby/bin/ /all-ruby/bin/
2426
COPY --from=docker.io/rubylang/all-ruby:ruby-2.2 /all-ruby/bin/ /all-ruby/bin/
@@ -112,7 +114,7 @@ COPY --from=docker.io/rubylang/all-ruby:ruby-2.5-3.1 /all-ruby/bin/ /all-ruby/bi
112114
COPY --from=docker.io/rubylang/all-ruby:ruby-3.2-4.0 /all-ruby/bin/ /all-ruby/bin/
113115

114116
# for Ruby 0.x and 1.1x (built on buster, need libcrypt.so.1)
115-
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.8.7 /lib/i386-linux-gnu/libcrypt.so.1.1.0 /lib/i386-linux-gnu/libcrypt.so.1.1.0
117+
COPY --from=docker.io/rubylang/all-ruby:ruby-1.2-1.6 /lib/i386-linux-gnu/libcrypt.so.1.1.0 /lib/i386-linux-gnu/libcrypt.so.1.1.0
116118
RUN cd /lib/i386-linux-gnu && ln -s libcrypt.so.1.1.0 libcrypt.so.1
117119

118120
# for Ruby 2.4-3.0 (built on bullseye, need libssl1.1/libcrypto1.1)

0 commit comments

Comments
 (0)