Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
23b5a7e
Update buildkit-proto to BuildKit v0.29.0
claude Apr 25, 2026
bef8d8b
buildkit-llb: align struct literals with v0.29 proto schema
claude Apr 26, 2026
32cffe6
buildkit-frontend: fill in new gateway proto fields on requests
claude Apr 26, 2026
077c659
buildkit-frontend: adapt RefResult::Ref to new Ref message type
claude Apr 26, 2026
49666c3
buildkit-proto: restore gRPC client generation via tonic-build 0.12
claude Apr 26, 2026
4f3b26b
fix mismatched_lifetime_syntaxes warnings on modern rustc
claude Apr 27, 2026
c6fc32b
buildkit-frontend: modernize transport stack for tonic 0.12
claude Apr 27, 2026
81c5237
fix clippy lints introduced by rustc upgrades
claude Apr 27, 2026
339c437
buildkit-llb: pin ops to a target platform via .platform() / .with_pl…
claude Apr 27, 2026
4505610
buildkit-frontend: multi-platform solve, return path and OCI image index
claude Apr 27, 2026
6ce31de
buildkit-frontend: extend oci API with all current OCI/Docker fields
claude Apr 28, 2026
6cbf078
feat: Platform serialization
taorepoara Apr 28, 2026
614d461
fix: Add missing proto
taorepoara May 20, 2026
7e07620
fix: Force exit
taorepoara May 20, 2026
b0a2c6b
test: Reverse example
taorepoara May 20, 2026
f3bd3f0
Update buildkit-proto to BuildKit v0.30.0
claude Jun 3, 2026
5268644
buildkit-proto: implement Display for Platform instead of ToString
claude Jun 3, 2026
126bebc
buildkit-llb, buildkit-frontend: bump Rust edition 2018 -> 2021
claude Jun 3, 2026
d230692
feat: Implement missing commands and options
taorepoara Jun 3, 2026
1ece428
buildkit-frontend: refresh stale dev-dependencies
claude Jun 3, 2026
e36ebe9
buildkit-llb: fix clone_on_copy lint on Tmpfs mount
claude Jun 3, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[workspace]
resolver = "2"
members = [
"buildkit-proto",
"buildkit-llb",
Expand Down
27 changes: 12 additions & 15 deletions buildkit-frontend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "buildkit-frontend"
version = "0.3.0"
authors = ["Denys Zariaiev <denys.zariaiev@gmail.com>"]
edition = "2018"
edition = "2021"

description = "Foundation for BuildKit frontends implemented in Rust"
documentation = "https://docs.rs/buildkit-frontend"
Expand All @@ -13,22 +13,19 @@ categories = ["development-tools::build-utils", "api-bindings"]
license = "MIT/Apache-2.0"

[dependencies]
bytes = "0.5"
either = "1.5"
failure = "0.1"
futures = "0.3"
libc = "0.2"
log = "0.4"
mio = "0.6"
pin-project = "0.4"
serde_json = "1.0"
tonic = "0.1"
tower = "0.3"
tonic = "0.12"
tower = { version = "0.5", features = ["util"] }
hyper-util = { version = "0.1", features = ["tokio"] }

[dependencies.tokio]
version = "0.2"
version = "1"
default-features = false
features = ["io-std"]
features = ["sync", "io-std", "io-util"]

[dependencies.serde]
version = "1.0"
Expand All @@ -48,11 +45,11 @@ path = "../buildkit-llb"

[dev-dependencies]
async-trait = "0.1"
env_logger = "0.6"
pretty_assertions = "0.6"
regex = "1.3"
url = "2.1"
env_logger = "0.11"
pretty_assertions = "1.4"
regex = "1.11"
url = "2.5"

[dev-dependencies.tokio]
version = "0.2"
features = ["macros", "rt-core", "rt-threaded"]
version = "1"
features = ["macros", "rt-multi-thread"]
21 changes: 9 additions & 12 deletions buildkit-frontend/examples/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ use buildkit_frontend::{Bridge, Frontend, FrontendOutput, OutputRef};

use buildkit_llb::prelude::*;

#[tokio::main(threaded_scheduler)]
#[tokio::main(flavor = "multi_thread")]
async fn main() {
env_logger::init();

if let Err(_) = run_frontend(DownloadFrontend).await {
if run_frontend(DownloadFrontend).await.is_err() {
std::process::exit(1);
}
}
Expand Down Expand Up @@ -59,18 +59,15 @@ impl DownloadFrontend {

architecture: Architecture::Amd64,
os: OperatingSystem::Linux,
os_version: None,
os_features: None,
variant: None,

config: Some(ImageConfig {
entrypoint: Some(vec!["/bin/sh".into()]),
cmd: Some(vec!["-c".into(), "/usr/bin/sha256sum *".into()]),
env: None,
user: None,
working_dir: Some(OUTPUT_DIR.into()),

labels: None,
volumes: None,
exposed_ports: None,
stop_signal: None,
..Default::default()
}),

rootfs: None,
Expand Down Expand Up @@ -102,7 +99,7 @@ impl DownloadFrontend {
let alpine = Source::image("alpine:latest").ref_counted();

let builder_rootfs = Command::run("apk")
.args(&["add", "curl"])
.args(["add", "curl"])
.custom_name("Installing curl")
.mount(Mount::Layer(OutputIdx(0), alpine.output(), "/"))
.ref_counted();
Expand All @@ -113,7 +110,7 @@ impl DownloadFrontend {
let full_path = PathBuf::from(OUTPUT_DIR).join(&relative_path);

let op = Command::run("curl")
.args(&[&url.to_string(), "-o", &full_path.to_string_lossy()])
.args([url.as_ref(), "-o", &full_path.to_string_lossy()])
.mount(Mount::ReadOnlyLayer(builder_rootfs.output(0), "/"))
.mount(Mount::Scratch(OutputIdx(0), OUTPUT_DIR))
.custom_name(format!("Downloading '{}'", relative_path.display()))
Expand Down Expand Up @@ -149,7 +146,7 @@ impl DownloadFrontend {
let cmd_regex = Regex::new(r#"Download\s+"(.+)"\s+as\s+"(.+)""#).unwrap();

dockerfile.lines().filter_map(move |line| {
let captures = cmd_regex.captures(&line)?;
let captures = cmd_regex.captures(line)?;
Some(Url::parse(&captures[1]).map(|url| (url, captures[2].into())))
})
}
Expand Down
16 changes: 5 additions & 11 deletions buildkit-frontend/examples/reverse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use buildkit_llb::prelude::*;
async fn main() {
env_logger::init();

if let Err(_) = run_frontend(ReverseFrontend).await {
if run_frontend(ReverseFrontend).await.is_err() {
std::process::exit(1);
}
}
Expand All @@ -40,18 +40,13 @@ impl ReverseFrontend {

architecture: Architecture::Amd64,
os: OperatingSystem::Linux,
os_version: None,
os_features: None,
variant: None,

config: Some(ImageConfig {
entrypoint: None,
cmd: Some(vec!["/bin/cat".into(), OUTPUT_FILENAME.into()]),
env: None,
user: None,
working_dir: None,

labels: None,
volumes: None,
exposed_ports: None,
stop_signal: None,
..Default::default()
}),

rootfs: None,
Expand All @@ -72,7 +67,6 @@ impl ReverseFrontend {
let transformed_contents: String = {
String::from_utf8_lossy(&dockerfile_contents)
.lines()
.into_iter()
.map(|line| {
line.trim()
.chars()
Expand Down
32 changes: 14 additions & 18 deletions buildkit-frontend/examples/ssh-mount.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ use buildkit_frontend::{Bridge, Frontend, FrontendOutput, Options, OutputRef};

use buildkit_llb::prelude::*;

#[tokio::main(basic_scheduler)]
#[tokio::main(flavor = "current_thread")]
async fn main() {
env_logger::init();

if let Err(_) = run_frontend(ReverseFrontend).await {
if run_frontend(ReverseFrontend).await.is_err() {
std::process::exit(1);
}
}
Expand Down Expand Up @@ -40,18 +40,14 @@ impl ReverseFrontend {

architecture: Architecture::Amd64,
os: OperatingSystem::Linux,
os_version: None,
os_features: None,
variant: None,

config: Some(ImageConfig {
entrypoint: None,
cmd: Some(vec!["/bin/cat".into(), OUTPUT_FILENAME.into()]),
env: None,
user: None,
working_dir: Some("/output".into()),

labels: None,
volumes: None,
exposed_ports: None,
stop_signal: None,
..Default::default()
}),

rootfs: None,
Expand All @@ -76,23 +72,23 @@ impl ReverseFrontend {
let mut test = None;

for line in dockerfile_contents.lines() {
if line.starts_with("REPO:") {
repo = Some(line[5..].trim());
if let Some(stripped) = line.strip_prefix("REPO:") {
repo = Some(stripped.trim());
}

if line.starts_with("TAG:") {
tag = Some(line[4..].trim());
if let Some(stripped) = line.strip_prefix("TAG:") {
tag = Some(stripped.trim());
}

if line.starts_with("TEST:") {
test = Some(line[5..].trim());
if let Some(stripped) = line.strip_prefix("TEST:") {
test = Some(stripped.trim());
}
}

let rootfs = Source::image("rust:latest");
let install_command = match (repo, tag) {
(Some(repo), Some(tag)) => Command::run("cargo")
.args(&["install", "--git", repo, "--tag", tag])
.args(["install", "--git", repo, "--tag", tag])
.mount(Mount::Layer(OutputIdx(0), rootfs.output(), "/"))
.mount(Mount::OptionalSshAgent("/tmp/ssh_agent.0"))
.env("PATH", PATH)
Expand All @@ -108,7 +104,7 @@ impl ReverseFrontend {

let test_command = if let Some(test) = test {
Command::run("/bin/sh")
.args(&["-c", &format!("{} > {}", test, OUTPUT_FILENAME)])
.args(["-c", &format!("{} > {}", test, OUTPUT_FILENAME)])
.mount(Mount::Layer(OutputIdx(0), install_command.output(0), "/"))
.env("PATH", PATH)
} else {
Expand Down
Loading