Skip to content

Instantly share code, notes, and snippets.

@1mm0rt41PC
Created October 30, 2023 22:00
Show Gist options
  • Save 1mm0rt41PC/1c8465414baae1b741c6bd5ce8528469 to your computer and use it in GitHub Desktop.
Save 1mm0rt41PC/1c8465414baae1b741c6bd5ce8528469 to your computer and use it in GitHub Desktop.
cat <<'EOD' | docker run -i --rm -v ./:/code rust:slim-buster bash
apt-get update && apt-get install -y curl gcc clang libclang-dev libgssapi-krb5-2 libkrb5-dev libsasl2-modules-gssapi-mit musl-tools gcc-mingw-w64-x86-64
curl https://sh.rustup.rs -sSf | sh -s -- -y
source "/usr/local/cargo/env"
cd /code
export targetbuild='x86_64-unknown-linux-gnu';
echo '##########################################################################'
echo -e "\033[34m$targetbuild\033[0m"
rustup install stable-$targetbuild --force-non-host
rustup target add $targetbuild
CFLAGS="-lrt";LDFLAGS="-lrt";RUSTFLAGS='-C target-feature=+crt-static';cargo build --release --target $targetbuild
cp /code/target/$targetbuild/release/rusthound /code/rusthound_$targetbuild
export targetbuild='x86_64-unknown-linux-musl'
echo '##########################################################################'
echo -e "\033[34m$targetbuild\033[0m"
rustup install $targetbuild --force-non-host
rustup target add $targetbuild
CFLAGS="-lrt";LDFLAGS="-lrt";RUSTFLAGS='-C target-feature=+crt-static';cargo build --release --target $targetbuild
cp /code/target/$targetbuild/release/rusthound /code/rusthound_$targetbuild
export targetbuild='x86_64-pc-windows-gnu'
echo '##########################################################################'
echo -e "\033[34m$targetbuild\033[0m"
rustup install stable-$targetbuild --force-non-host
rustup target add $targetbuild
RUSTFLAGS="-C target-feature=+crt-static" cargo build --release --target $targetbuild
cp /code/target/$targetbuild/release/rusthound.exe /code/rusthound_${targetbuild}.exe
rm -rf /code/target
EOD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment