File tree 2 files changed +7
-1
lines changed
2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ ENV OPENSSL_INCLUDE_DIR=/usr/include/
63
63
# Install the rust toolchain
64
64
RUN export ARCH="$(uname -m)" \
65
65
&& nohup curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain "$RUST_TOOLCHAIN" \
66
+ && rustup target add aarch64-unknown-linux-gnu \
67
+ && rustup target add x86_64-unknown-linux-gnu \
66
68
&& rustup component add rustfmt \
67
69
&& rustup component add clippy \
68
70
&& rustup component add rust-src \
Original file line number Diff line number Diff line change @@ -227,6 +227,9 @@ cmd_build() {
227
227
228
228
process_volumes_args
229
229
230
+ [ " $( uname -m) " == " aarch64" ] && target=" aarch64-unknown-none.json"
231
+ [ " $( uname -m) " == " x86_64" ] && target=" x86_64-unknown-none.json"
232
+
230
233
cargo_args=(" $@ " )
231
234
[ $build = " release" ] && cargo_args+=(" --release" )
232
235
@@ -240,7 +243,7 @@ cmd_build() {
240
243
--volume " $RHF_ROOT_DIR :$CTR_RHF_ROOT_DIR " $exported_volumes \
241
244
--env RUSTFLAGS=" $rustflags " \
242
245
" $CTR_IMAGE " \
243
- cargo build --target " x86_64-unknown-none.json " \
246
+ cargo build --target " $target " \
244
247
-Zbuild-std=core,alloc \
245
248
-Zbuild-std-features=compiler-builtins-mem \
246
249
--target-dir " $CTR_RHF_CARGO_TARGET " \
@@ -399,6 +402,7 @@ cmd_build-container() {
399
402
mkdir -p $BUILD_DIR
400
403
cp $RHF_DOCKERFILE $BUILD_DIR
401
404
405
+ [ $( uname -m) = " aarch64" ] && TARGETARCH=" arm64"
402
406
[ $( uname -m) = " x86_64" ] && TARGETARCH=" amd64"
403
407
RUST_TOOLCHAIN=" $( rustup show active-toolchain | cut -d ' ' -f1) "
404
408
You can’t perform that action at this time.
0 commit comments