add with dockerfile

This commit is contained in:
2023-02-17 17:50:45 +01:00
parent 728840ca8e
commit 0cbd1790b0
24 changed files with 30092 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
use dagger_sdk::gen::HostDirectoryOpts;
use rand::Rng;
fn main() -> eyre::Result<()> {
let mut rng = rand::thread_rng();
let client = dagger_sdk::client::connect()?;
let context_dir = client
.host()
.directory("./examples/existing-dockerfile/app".into(), None);
let ref_ = client
.container(None)
.build(context_dir.id(), None)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
println!("published image to: {}", ref_);
Ok(())
}