xref: /DragonOS/tools/build_in_docker.sh (revision a8753f8fffb992e4d3bbd21eda431081b395af6b)
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