Skip to content

Commit 407509a

Browse files
committed
Streamline runit build for amd64 and arm64
`package/check` (part of `package/install`) fails on qemu emulated arm64 build without the hacks we made in [1]. However, this hack will break native arm64 build [2]. This change workaround this issue by calling `pacpackage/compile` as the runit binaries are important to us and copied in the next stage. [1] https://github.com/projectcalico/node/pull/1044/files#diff-02ae637382f3cca949bd439c8b796acdb08abfbbe4b712eafae1bb80dd08f866R99 [2] #8285
1 parent 8dec244 commit 407509a

File tree

2 files changed

+8
-12
lines changed

2 files changed

+8
-12
lines changed

node/Dockerfile.amd64

+4-6
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,9 @@ RUN rpm -i ${IPSET_SOURCERPM_URL} && \
7575

7676
# runit is not available in ubi or CentOS repos so build it.
7777
# get it from the debian repos as the official website doesn't support https
78-
RUN wget -P /tmp https://ftp.debian.org/debian/pool/main/r/runit/runit_${RUNIT_VER}.orig.tar.gz && \
79-
gunzip /tmp/runit_${RUNIT_VER}.orig.tar.gz && \
80-
tar -xpf /tmp/runit_${RUNIT_VER}.orig.tar -C /tmp && \
81-
cd /tmp/admin/runit-${RUNIT_VER}/ && \
82-
package/install
78+
RUN curl -sfL https://ftp.debian.org/debian/pool/main/r/runit/runit_${RUNIT_VER}.orig.tar.gz | tar xz -C /root && \
79+
cd /root/admin/runit-${RUNIT_VER} && \
80+
package/compile
8381

8482
FROM ${UBI_IMAGE} as ubi
8583

@@ -93,7 +91,7 @@ ARG RUNIT_VER
9391
RUN microdnf upgrade
9492

9593
# Copy in runit binaries
96-
COPY --from=centos /tmp/admin/runit-${RUNIT_VER}/command/* /usr/local/bin/
94+
COPY --from=centos /root/admin/runit-${RUNIT_VER}/command/* /usr/local/bin/
9795

9896
# Copy in our rpms
9997
COPY --from=centos /root/rpmbuild/RPMS/x86_64/* /tmp/rpms/

node/Dockerfile.arm64

+4-6
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,9 @@ RUN rpm -i ${IPSET_SOURCERPM_URL} && \
8181

8282
# runit is not available in ubi or CentOS repos so build it.
8383
# get it from the debian repos as the official website doesn't support https
84-
RUN wget -P /tmp https://ftp.debian.org/debian/pool/main/r/runit/runit_${RUNIT_VER}.orig.tar.gz && \
85-
gunzip /tmp/runit_${RUNIT_VER}.orig.tar.gz && \
86-
tar -xpf /tmp/runit_${RUNIT_VER}.orig.tar -C /tmp && \
87-
cd /tmp/admin/runit-${RUNIT_VER}/ && \
88-
package/install
84+
RUN curl -sfL https://ftp.debian.org/debian/pool/main/r/runit/runit_${RUNIT_VER}.orig.tar.gz | tar xz -C /root && \
85+
cd /root/admin/runit-${RUNIT_VER} && \
86+
package/compile
8987

9088
FROM ${UBI_IMAGE} as ubi
9189

@@ -103,7 +101,7 @@ COPY --from=qemu /usr/bin/qemu-aarch64-static /usr/bin/qemu-aarch64-static
103101
RUN microdnf upgrade
104102

105103
# Copy in runit binaries
106-
COPY --from=centos /tmp/admin/runit-${RUNIT_VER}/command/* /usr/local/bin/
104+
COPY --from=centos /root/admin/runit-${RUNIT_VER}/command/* /usr/local/bin/
107105

108106
# Copy in our rpms
109107
COPY --from=centos /root/rpmbuild/RPMS/aarch64/* /tmp/rpms/

0 commit comments

Comments
 (0)