Skip to content

canonical/rust-rock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rust rock

This repository contains the SDK rock definitions for the rust programming language.

This contains a minimal Rust toolchain and Cargo build system which can be used to build a wide variety of Rust applications. It also includes a minimal GCC toolchain to custom build steps in Cargo builds.

Any additional dependencies can be either mounted at runtime or installed with the apt installation included in this rock.

Example

Let's build sudo-rs!

First clone the repository and checkout a specific tag:

git clone --depth 1 --branch v0.2.8 https://github.com/trifectatechfoundation/sudo-rs
cd sudo-rs

Now lets launch the rust container with the code directory mounted:

$ docker run --name=my-rust-rock --rm -it -v ./:/work rust:1.75
2025-12-17T16:33:37.340Z [pebble] {"type":"security","datetime":"2025-12-17T16:33:37Z","level":"WARN","event":"sys_startup:0","description":"Starting daemon","appid":"pebble"}
2025-12-17T16:33:37.341Z [pebble] Started daemon.
2025-12-17T16:33:37.341Z [pebble] POST /v1/services 78.436µs 400 (http+unix)
2025-12-17T16:33:37.341Z [pebble] Cannot start default services: no default services

The rock is running, but pebble - the container entrypoint does not have any entry point. This is fine! This is not a rock with a service. Its for building applications. Let's now log into the container and build the application. In a separate terminal run:

docker exec -it my-rust-rock sh

to get a shell. Then, lets install the dependency of sudo-rs:

apt update && apt install --yes tzdata libpam0g-dev

and compile:

cd /work && cargo build --release

Let's now log out of the container and try our binary:

$ ./target/release/su --help
Usage: su [options] [-] [<user> [<argument>...]]

Change the effective user ID and group ID to that of <user>.
A mere - implies -l.  If <user> is not given, root is assumed.

Voilà.

Available versions

About

Iron oxide

Resources

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages