Build from source
Build from source to run an unreleased commit, to target a platform without a release archive, or to audit what you run.
What you need
Section titled “What you need”- Rust through rustup. The repository pins the toolchain in
rust-toolchain.toml(currently Rust 1.99.1); rustup installs it the first time you runcargoin the repository. The minimum supported Rust version is 1.89 (rust-versioninCargo.toml). - A C compiler and CMake. Pingora builds zlib-ng with CMake, and ring and zstd need a C compiler.
- Debian or Ubuntu:
sudo apt install build-essential cmake - Alpine:
apk add musl-dev cmake make - macOS:
xcode-select --install && brew install cmake
- Debian or Ubuntu:
- git.
Build the binary
Section titled “Build the binary”git clone https://github.com/Docker-Hunterpedia/ReverseDock.gitcd ReverseDockgit checkout v0.3.0-alpha.1cargo build --release --locked -p rdock./target/release/rdock version--locked builds with the exact dependency versions of Cargo.lock, as the release workflow does. Leave out the git checkout to build the latest main.
rdock version prints the commit it was built from. Set RDOCK_BUILD_COMMIT to record your own value; without it, local builds report dev.
Install it like a release binary:
sudo install -m 0755 target/release/rdock /usr/local/bin/rdockA static Linux binary
Section titled “A static Linux binary”The release archives are built for the musl targets. To do the same on Linux, install the musl tools (sudo apt install musl-tools on Debian or Ubuntu) and add the target:
rustup target add x86_64-unknown-linux-muslcargo build --release --locked -p rdock --target x86_64-unknown-linux-muslThe binary is in target/x86_64-unknown-linux-musl/release/rdock.
Build a container image
Section titled “Build a container image”The Dockerfile at the repository root compiles rdock on Alpine and copies it into a distroless, non-root image:
docker build -t rdock:dev .docker run --rm rdock:dev versionUse rdock:dev instead of ghcr.io/docker-hunterpedia/rdock:0.3.0-alpha.1 in the Docker and Compose instructions. Release images are built differently, from the signed release binaries, by Dockerfile.release.
Run the tests
Section titled “Run the tests”cargo test -p rdockThe end-to-end suites in crates/rdock/tests start the real binary against test backends. Contributors use just ci for the full set of checks; see Contributing.