You can use this container to build Cargo packages for CentOS. Simply change to the root directory of a Cargo project, create an appropriate target directory
mkdir -p target/centos
and invoke Cargo in the container
docker run \
--user $(id -u):$(id -g) \
-t --rm \
-v "$PWD:/source" \
-v "$PWD/target/centos:/source/target" \
accuminium/rust-centos:8.2.2004_stable \
cargo build --release
Adapt the version of the container (8.2.2004_stable
in this example) as needed.