initrd/build-init

30 lines
539 B
Plaintext
Raw Normal View History

2024-05-14 22:59:57 +00:00
set -ex
which podman &>/dev/null && docker=podman || docker=docker
mkdir -p empty
$docker build -t nv-rs-build --network=host -f Dockerfile.build empty
case $1 in
release)
opts=--release
bindir=target/release
;;
"")
bindir=target/debug
;;
*)
echo >&2 "invalid arg: $1"
exit 1
;;
esac
$docker run --rm -i --net=host --user=$UID \
-v $HOME/.cargo-alpine/registry:/usr/local/cargo/registry \
-v $PWD:/src -w /src \
nv-rs-build \
cargo build $opts
mkdir -p dist
cp $bindir/init dist/