Begin by cloning the repository and building the Docker container:
git clone https://github.com/rustdesk/rustdesk cd rustdesk docker build -t "rustdesk-builder" .
Then, each time you need to build the application, run the following command:
docker run --rm -it -v $PWD:/home/user/rustdesk -v rustdesk-git-cache:/home/user/.cargo/git -v rustdesk-registry-cache:/home/user/.cargo/registry -e PUID="$(id -u)" -e PGID="$(id -g)" rustdesk-builder
Note that the first build may take longer before dependencies are cached, subsequent builds will be faster. Additionally, if you need to specify different arguments to the build command, you may do so at the end of the command in the
<OPTIONAL-ARGS> position. For instance, if you wanted to build an optimized release version, you would run the command above followed by
--release. The resulting executable will be available in the target folder on your system, and can be run with:
Or, if you’re running a release executable:
Please ensure that you are running these commands from the root of the RustDesk repository, otherwise the application may be unable to find the required resources. Also note that other cargo subcommands such as
run are not currently supported via this method as they would install or run the program inside the container instead of the host.