mirror of
https://github.com/kjuulh/dagger-rs.git
synced 2024-11-13 04:22:17 +01:00
kjuulh
6779808322
Now all opt values enter into a _opts function instead of the original. This avoids a lot of verbosity for both None in the case opts are unwanted, and Some() if they actually are. They are used like so: ```rust client.container().from("..."); client.container_opts(Some(ContainerOpts{ ... })) ``` Some from opts will be removed in a future commit/pr
21 lines
449 B
Rust
21 lines
449 B
Rust
use rand::Rng;
|
|
|
|
fn main() -> eyre::Result<()> {
|
|
let mut rng = rand::thread_rng();
|
|
|
|
let client = dagger_sdk::connect()?;
|
|
|
|
let context_dir = client
|
|
.host()
|
|
.directory("./examples/existing-dockerfile/app");
|
|
|
|
let ref_ = client
|
|
.container()
|
|
.build(context_dir.id()?)
|
|
.publish(format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()))?;
|
|
|
|
println!("published image to: {}", ref_);
|
|
|
|
Ok(())
|
|
}
|