Skip to content

Commit

Permalink
doc: document initramfs builder tool
Browse files Browse the repository at this point in the history
Signed-off-by: Nils Ponsard <[email protected]>
  • Loading branch information
nponsard committed Nov 20, 2023
1 parent 62eddb9 commit e4d22fb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions initramfs/src/httpclient.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::{anyhow, Result};
use reqwest::{Client, Response};

/// Wrapper around reqwest to run a GET request with bearer auth
pub async fn run_get_request(url: &str, token: Option<&str>) -> Result<Response> {
let res = match token {
Some(token) => Client::new().get(url).bearer_auth(token),
Expand Down
1 change: 1 addition & 0 deletions initramfs/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ pub struct Layer {
pub content: Cursor<Bytes>,
}

/// Represents a container image
pub struct Image {
name: String,
tag: String,
Expand Down
11 changes: 11 additions & 0 deletions initramfs/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
//! This is a tool to transform a container image into an initramfs image.
//! It will download the image from a container registry, extract it and
//! write it to disk.
//! The initramfs image will contain the init binary/script and the agent
//! binary as well as the agent configuration file.
//! The init binary will be the entrypoint of the initramfs image and will
//! start the agent binary.
//!
//! This image can then be used as an initramfs image for a linux kernel
//! in the lambdo runtime.
use std::fs::File;

use anyhow::anyhow;
Expand Down
1 change: 1 addition & 0 deletions initramfs/src/registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct ManifestResponse {
fsLayers: Vec<LayerMetadata>,
}

/// A container registry (e.g. docker hub)
pub struct Registry {
url: String,
auth_url: String,
Expand Down

0 comments on commit e4d22fb

Please sign in to comment.