Install and build `railcar`
masterTo build railcar from source, you must first install the Rust toolchain and its dependencies. You can build either a dynamic binary (default) or a static binary using musl.
Rust Setup
Install Rust and the necessary toolchains:
curl https://sh.rustup.rs -sSf | sh
cargo install cargo-when
# For stable builds
rustup toolchain install stable-x86_64-unknown-linux-gnu
rustup default stable-x86_64-unknown-linux-gnu
rustup target install x86_64-unknown-linux-musl
# For nightly builds
rustup toolchain install nightly-x86_64-unknown-linux-gnu
rustup default nightly-x86_64-unknown-linux-gnu
rustup target install x86_64-unknown-linux-muslBuilding
Use the provided build.sh script to compile the project.
- Dynamic build (default): Requires
libseccomp-devel. - Static build: Requires
git submodule update --init,autotools,make,gcc, andmusl-gcc. Set theTARGETenvironment variable tox86_64-unknown-linux-musl. - Release build: Use the
--releaseflag.
Note: If you build using the stable toolchain instead of nightly, the set_name feature is disabled, meaning the container's init process will not be named rc-init in ps or /proc/$pid/cmdline.
# Build a static binary
TARGET=x86_64-unknown-linux-musl ./build.sh
# Build a release version
build.sh --release