Skip to content

Commit 18489dc

Browse files
author
Claudio Raimondi
committed
Add cross compilers
1 parent db48b79 commit 18489dc

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

Dockerfile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,16 +133,22 @@ FROM base-builder AS base-builder-linux-amd64
133133

134134
ARG target_host=x86_64-linux-gnu
135135
ARG target_host_rust=x86_64-unknown-linux-gnu
136+
ARG target_host_libc=amd64
137+
ARG target_host_gcc=x86-64-linux-gnu
136138

137139
FROM base-builder AS base-builder-linux-arm64
138140

139141
ARG target_host=aarch64-linux-gnu
140142
ARG target_host_rust=aarch64-unknown-linux-gnu
143+
ARG target_host_libc=arm64
144+
ARG target_host_gcc=aarch64-linux-gnu
141145

142146
FROM base-builder AS base-builder-linux-arm
143147

144148
ARG target_host=arm-linux-gnueabihf
145149
ARG target_host_rust=armv7-unknown-linux-gnueabihf
150+
ARG target_host_libc=armhf
151+
ARG target_host_gcc=arm-linux-gnueabihf
146152

147153
FROM base-builder-${TARGETOS}-${TARGETARCH} AS builder
148154

@@ -159,6 +165,11 @@ ARG QEMU_LD_PREFIX=/usr/${target_host}
159165
ARG TARGET=${target_host_rust}
160166
ARG PKG_CONFIG_PATH=${QEMU_LD_PREFIX}/lib/pkgconfig
161167

168+
RUN apt-get install -qq -y --no-install-recommends \
169+
libc6-${target_host_libc}-cross \
170+
gcc-${target_host_gcc} \
171+
g++-${target_host_gcc}
172+
162173
WORKDIR /opt
163174

164175
RUN ./install-rust.sh -y --target ${target_host_rust} --default-host ${target_host_rust} --profile minimal
@@ -205,7 +216,7 @@ RUN poetry lock && \
205216
poetry install --no-root --no-interaction --no-ansi
206217

207218
RUN ./configure --prefix=/tmp/lightning_install --enable-static
208-
RUN poetry run make install
219+
RUN poetry run make -j install
209220

210221
RUN for f in /tmp/lightning_install/bin/*; do \
211222
if file "$f" | grep -q ELF; then \

0 commit comments

Comments
 (0)