xref: /DragonOS/tools/build_in_docker.sh (revision fae6e9ade46a52976ad5d099643d51cc20876448)
1docker rm -f dragonos-build || echo "No existed container"
2cpu_count=$(cat /proc/cpuinfo |grep "processor"|wc -l)
3docker run --rm --privileged=true --cap-add SYS_ADMIN --cap-add MKNOD -v $(pwd):/data -v /dev:/dev -v dragonos-build-cargo:/root/.cargo/registry --name dragonos-build -i dragonos/dragonos-dev:v1.2 bash << EOF
4source ~/.cargo/env
5source ~/.bashrc
6cd /data
7# Change rust src
8bash tools/change_rust_src.sh
9make all -j $cpu_count
10EOF