dagger-components/examples/rust-build/src/main.rs
kjuulh 52914e08e6
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone Build is passing
feat: with updated dagger-sdk
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-10-21 12:45:33 +02:00

30 lines
769 B
Rust

use dagger_rust::build::{RustVersion, SlimImage};
#[tokio::main]
pub async fn main() -> eyre::Result<()> {
let client = dagger_sdk::connect().await?;
let rust_build = dagger_rust::build::RustBuild::new(client.clone());
let containers = rust_build
.build_release(
Some("testdata"),
RustVersion::Nightly,
&["crates/*"],
&["openssl"],
vec![SlimImage::Debian {
image: "debian:bookworm".into(),
deps: vec!["openssl".into()],
architecture: dagger_rust::build::BuildArchitecture::Amd64,
}],
"example_bin",
)
.await?;
for container in containers {
container.sync().await?;
}
Ok(())
}