File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ ENV OPENSSL_INCLUDE_DIR=/usr/include/
6363# Install the rust toolchain
6464RUN export ARCH="$(uname -m)" \
6565 && 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 \
6668 && rustup component add rustfmt \
6769 && rustup component add clippy \
6870 && rustup component add rust-src \
Original file line number Diff line number Diff line change @@ -227,6 +227,9 @@ cmd_build() {
227227
228228 process_volumes_args
229229
230+ [ " $( uname -m) " == " aarch64" ] && target=" aarch64-unknown-none.json"
231+ [ " $( uname -m) " == " x86_64" ] && target=" x86_64-unknown-none.json"
232+
230233 cargo_args=(" $@ " )
231234 [ $build = " release" ] && cargo_args+=(" --release" )
232235
@@ -240,7 +243,7 @@ cmd_build() {
240243 --volume " $RHF_ROOT_DIR :$CTR_RHF_ROOT_DIR " $exported_volumes \
241244 --env RUSTFLAGS=" $rustflags " \
242245 " $CTR_IMAGE " \
243- cargo build --target " x86_64-unknown-none.json " \
246+ cargo build --target " $target " \
244247 -Zbuild-std=core,alloc \
245248 -Zbuild-std-features=compiler-builtins-mem \
246249 --target-dir " $CTR_RHF_CARGO_TARGET " \
@@ -399,6 +402,7 @@ cmd_build-container() {
399402 mkdir -p $BUILD_DIR
400403 cp $RHF_DOCKERFILE $BUILD_DIR
401404
405+ [ $( uname -m) = " aarch64" ] && TARGETARCH=" arm64"
402406 [ $( uname -m) = " x86_64" ] && TARGETARCH=" amd64"
403407 RUST_TOOLCHAIN=" $( rustup show active-toolchain | cut -d ' ' -f1) "
404408
You can’t perform that action at this time.
0 commit comments