Skip to content

Commit

Permalink
[buildx] fix docker buildcloud
Browse files Browse the repository at this point in the history
  • Loading branch information
tsirysndr committed Sep 14, 2024
1 parent 1c55015 commit 06ff147
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion buildx/dagger.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
2 changes: 1 addition & 1 deletion buildx/plugin/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "buildx"
version = "0.1.3"
version = "0.1.4"

[lib]
crate-type = ["cdylib"]
Expand Down
16 changes: 12 additions & 4 deletions buildx/plugin/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ pub fn build_cloud(args: String) -> FnResult<String> {
);

let buildx_plugin = format!("buildx-{}.{}-{}", version, os, arch);
let builder_name = format!("cloud-{}", builder.replace("/", "-"));
let stdout = dag()
.pipeline("build")?
.pkgx()?
Expand All @@ -87,14 +88,21 @@ pub fn build_cloud(args: String) -> FnResult<String> {
"#,
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)
}
Expand Down

0 comments on commit 06ff147

Please sign in to comment.