diff --git a/Cargo.lock b/Cargo.lock index 020bd00..bd9f362 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,7 +52,7 @@ dependencies = [ [[package]] name = "buildx" -version = "0.1.3" +version = "0.1.4" dependencies = [ "anyhow", "extism-pdk", diff --git a/buildx/dagger.json b/buildx/dagger.json index 7273bf0..e7e77e6 100644 --- a/buildx/dagger.json +++ b/buildx/dagger.json @@ -1,7 +1,7 @@ { "name": "buildx", "sdk": "github.com/fluentci-io/daggerverse/deno-sdk@main", - "version": "v0.1.3", + "version": "v0.1.4", "description": "", "author": "Tsiry Sandratraina", "license": "MIT" diff --git a/buildx/plugin/Cargo.toml b/buildx/plugin/Cargo.toml index 7236cc8..d470d00 100644 --- a/buildx/plugin/Cargo.toml +++ b/buildx/plugin/Cargo.toml @@ -1,7 +1,7 @@ [package] edition = "2021" name = "buildx" -version = "0.1.3" +version = "0.1.4" [lib] crate-type = ["cdylib"] diff --git a/buildx/plugin/src/lib.rs b/buildx/plugin/src/lib.rs index 2d487bf..a70f9c8 100644 --- a/buildx/plugin/src/lib.rs +++ b/buildx/plugin/src/lib.rs @@ -72,6 +72,7 @@ pub fn build_cloud(args: String) -> FnResult { ); let buildx_plugin = format!("buildx-{}.{}-{}", version, os, arch); + let builder_name = format!("cloud-{}", builder.replace("/", "-")); let stdout = dag() .pipeline("build")? .pkgx()? @@ -87,14 +88,21 @@ pub fn build_cloud(args: String) -> FnResult { "#, buildx_download_url, buildx_plugin, buildx_plugin )])? + .with_exec(vec!["docker buildx rm builder || true"])? + .with_exec(vec!["docker", "buildx", "version"])? + .with_exec(vec!["docker", "-v"])? .with_exec(vec![&format!( "docker buildx create --driver cloud {} || true", &builder )])? - .with_exec(vec!["docker", "buildx", "inspect", "--bootstrap"])? - .with_exec(vec!["docker", "buildx", "version"])? - .with_exec(vec!["docker", "-v"])? - .with_exec(vec!["docker", "buildx", "build", &args])? + .with_exec(vec![ + "docker", + "buildx", + "build", + "--builder", + &builder_name, + &args, + ])? .stdout()?; Ok(stdout) }