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