pub struct Builder { /* private fields */ }Expand description
Builder struct for buildah operations
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn container_id(&self) -> Option<&String>
pub fn container_id(&self) -> Option<&String>
Get the container ID
Sourcepub fn run(&self, command: &str) -> Result<CommandResult, BuildahError>
pub fn run(&self, command: &str) -> Result<CommandResult, BuildahError>
Sourcepub fn run_with_isolation(
&self,
command: &str,
isolation: &str,
) -> Result<CommandResult, BuildahError>
pub fn run_with_isolation( &self, command: &str, isolation: &str, ) -> Result<CommandResult, BuildahError>
Sourcepub fn copy(
&self,
source: &str,
dest: &str,
) -> Result<CommandResult, BuildahError>
pub fn copy( &self, source: &str, dest: &str, ) -> Result<CommandResult, BuildahError>
Sourcepub fn add(
&self,
source: &str,
dest: &str,
) -> Result<CommandResult, BuildahError>
pub fn add( &self, source: &str, dest: &str, ) -> Result<CommandResult, BuildahError>
Sourcepub fn commit(&self, image_name: &str) -> Result<CommandResult, BuildahError>
pub fn commit(&self, image_name: &str) -> Result<CommandResult, BuildahError>
Sourcepub fn remove(&self) -> Result<CommandResult, BuildahError>
pub fn remove(&self) -> Result<CommandResult, BuildahError>
Sourcepub fn reset(&mut self) -> Result<(), BuildahError>
pub fn reset(&mut self) -> Result<(), BuildahError>
Reset the builder by removing the container and clearing the container_id
§Returns
Result<(), BuildahError>- Success or error
Sourcepub fn config(
&self,
options: HashMap<String, String>,
) -> Result<CommandResult, BuildahError>
pub fn config( &self, options: HashMap<String, String>, ) -> Result<CommandResult, BuildahError>
Sourcepub fn set_entrypoint(
&self,
entrypoint: &str,
) -> Result<CommandResult, BuildahError>
pub fn set_entrypoint( &self, entrypoint: &str, ) -> Result<CommandResult, BuildahError>
Sourcepub fn set_cmd(&self, cmd: &str) -> Result<CommandResult, BuildahError>
pub fn set_cmd(&self, cmd: &str) -> Result<CommandResult, BuildahError>
Sourcepub fn image_remove(image: &str) -> Result<CommandResult, BuildahError>
pub fn image_remove(image: &str) -> Result<CommandResult, BuildahError>
Sourcepub fn image_remove_with_debug(
image: &str,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_remove_with_debug( image: &str, debug: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_pull(
image: &str,
tls_verify: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_pull( image: &str, tls_verify: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_pull_with_debug(
image: &str,
tls_verify: bool,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_pull_with_debug( image: &str, tls_verify: bool, debug: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_push(
image: &str,
destination: &str,
tls_verify: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_push( image: &str, destination: &str, tls_verify: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_push_with_debug(
image: &str,
destination: &str,
tls_verify: bool,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_push_with_debug( image: &str, destination: &str, tls_verify: bool, debug: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_tag(
image: &str,
new_name: &str,
) -> Result<CommandResult, BuildahError>
pub fn image_tag( image: &str, new_name: &str, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_tag_with_debug(
image: &str,
new_name: &str,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_tag_with_debug( image: &str, new_name: &str, debug: bool, ) -> Result<CommandResult, BuildahError>
Sourcepub fn image_commit(
container: &str,
image_name: &str,
format: Option<&str>,
squash: bool,
rm: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_commit( container: &str, image_name: &str, format: Option<&str>, squash: bool, rm: bool, ) -> Result<CommandResult, BuildahError>
Commit a container to an image with advanced options
§Arguments
container- Container ID or nameimage_name- Name for the new imageformat- Optional format (oci or docker)squash- Whether to squash layersrm- Whether to remove the container after commit
§Returns
Result<CommandResult, BuildahError>- Command result or error
Sourcepub fn image_commit_with_debug(
container: &str,
image_name: &str,
format: Option<&str>,
squash: bool,
rm: bool,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn image_commit_with_debug( container: &str, image_name: &str, format: Option<&str>, squash: bool, rm: bool, debug: bool, ) -> Result<CommandResult, BuildahError>
Commit a container to an image with advanced options and debug output
§Arguments
container- Container ID or nameimage_name- Name for the new imageformat- Optional format (oci or docker)squash- Whether to squash layersrm- Whether to remove the container after commitdebug- Whether to enable debug output
§Returns
Result<CommandResult, BuildahError>- Command result or error
Sourcepub fn build(
tag: Option<&str>,
context_dir: &str,
file: &str,
isolation: Option<&str>,
) -> Result<CommandResult, BuildahError>
pub fn build( tag: Option<&str>, context_dir: &str, file: &str, isolation: Option<&str>, ) -> Result<CommandResult, BuildahError>
Build an image from a Containerfile/Dockerfile
§Arguments
tag- Optional tag for the imagecontext_dir- Directory containing the Containerfile/Dockerfilefile- Path to the Containerfile/Dockerfileisolation- Optional isolation method
§Returns
Result<CommandResult, BuildahError>- Command result or error
Sourcepub fn build_with_debug(
tag: Option<&str>,
context_dir: &str,
file: &str,
isolation: Option<&str>,
debug: bool,
) -> Result<CommandResult, BuildahError>
pub fn build_with_debug( tag: Option<&str>, context_dir: &str, file: &str, isolation: Option<&str>, debug: bool, ) -> Result<CommandResult, BuildahError>
Build an image from a Containerfile/Dockerfile with debug output
§Arguments
tag- Optional tag for the imagecontext_dir- Directory containing the Containerfile/Dockerfilefile- Path to the Containerfile/Dockerfileisolation- Optional isolation methoddebug- Whether to enable debug output
§Returns
Result<CommandResult, BuildahError>- Command result or error
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Builder
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl UnwindSafe for Builder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more