mirror of
https://github.com/imjasonh/krust
synced 2026-07-11 16:10:00 +00:00
fix: implement cross-registry layer copying for layered images
Resolves GitHub issue #28 by implementing proper layered image building that preserves base image properties and handles cross-registry scenarios. Changes: - Enhanced push_layered_image() to detect cross-registry pushes and copy base layers - Implemented automatic blob copying from source registry to destination registry - Always use layered approach instead of falling back to single-layer builds - Added verification tests to ensure base image environment and files are preserved - Consolidated unit tests into module files for better organization This fixes "MANIFEST_BLOB_UNKNOWN" errors when pushing layered images that reference base image blobs from different registries (e.g., cgr.dev → ttl.sh). 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
f8271d0381
commit
e0df56704a
6 changed files with 629 additions and 99 deletions
|
|
@ -1,4 +1,17 @@
|
|||
fn main() {
|
||||
println!("Hello from krust example!");
|
||||
println!("This is running inside a container built with krust.");
|
||||
println!("Current architecture: {}", std::env::consts::ARCH);
|
||||
|
||||
// Check for SSL_CERT_FILE environment variable (common in distroless images)
|
||||
match std::env::var("SSL_CERT_FILE") {
|
||||
Ok(value) => println!("✓ SSL_CERT_FILE found: {}", value),
|
||||
Err(_) => panic!("✗ SSL_CERT_FILE not found (base image env not preserved)"),
|
||||
}
|
||||
|
||||
// Check for /etc/os-release file (common in most Linux base images)
|
||||
if std::path::Path::new("/etc/os-release").exists() {
|
||||
println!("✓ /etc/os-release found (base image layers preserved)");
|
||||
} else {
|
||||
panic!("✗ /etc/os-release not found (base image layers not preserved)");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue