feat: Add platform arg to force building a specific architecture
This commit is contained in:
parent
20d1950530
commit
75eae89e4a
22 changed files with 408 additions and 71 deletions
|
|
@ -2,6 +2,8 @@ use std::{borrow::Cow, path::Path};
|
|||
|
||||
use bon::Builder;
|
||||
|
||||
use crate::drivers::types::Platform;
|
||||
|
||||
use super::CompressionType;
|
||||
|
||||
/// Options for building
|
||||
|
|
@ -15,14 +17,15 @@ pub struct BuildOpts<'scope> {
|
|||
|
||||
#[builder(into)]
|
||||
pub containerfile: Cow<'scope, Path>,
|
||||
|
||||
#[builder(default)]
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Builder)]
|
||||
#[builder(on(Cow<'_, str>, into))]
|
||||
pub struct TagOpts<'scope> {
|
||||
#[builder(into)]
|
||||
pub src_image: Cow<'scope, str>,
|
||||
|
||||
#[builder(into)]
|
||||
pub dest_image: Cow<'scope, str>,
|
||||
}
|
||||
|
||||
|
|
@ -80,4 +83,8 @@ pub struct BuildTagPushOpts<'scope> {
|
|||
/// Run all steps in a single layer.
|
||||
#[builder(default)]
|
||||
pub squash: bool,
|
||||
|
||||
/// The platform to build the image on.
|
||||
#[builder(default)]
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,12 +3,17 @@ use std::borrow::Cow;
|
|||
use bon::Builder;
|
||||
use oci_distribution::Reference;
|
||||
|
||||
use crate::drivers::types::Platform;
|
||||
|
||||
#[derive(Debug, Clone, Builder)]
|
||||
pub struct GenerateTagsOpts<'scope> {
|
||||
pub oci_ref: &'scope Reference,
|
||||
|
||||
#[builder(into)]
|
||||
pub alt_tags: Option<Vec<Cow<'scope, str>>>,
|
||||
|
||||
#[builder(default)]
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Builder)]
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ use std::borrow::Cow;
|
|||
|
||||
use bon::Builder;
|
||||
|
||||
use crate::drivers::types::Platform;
|
||||
|
||||
#[derive(Debug, Clone, Builder)]
|
||||
pub struct GetMetadataOpts<'scope> {
|
||||
#[builder(into)]
|
||||
|
|
@ -9,4 +11,7 @@ pub struct GetMetadataOpts<'scope> {
|
|||
|
||||
#[builder(into)]
|
||||
pub tag: Option<Cow<'scope, str>>,
|
||||
|
||||
#[builder(default)]
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ use bon::Builder;
|
|||
use miette::{IntoDiagnostic, Result};
|
||||
use zeroize::{Zeroize, Zeroizing};
|
||||
|
||||
use crate::drivers::types::Platform;
|
||||
|
||||
pub enum PrivateKey {
|
||||
Env(String),
|
||||
Path(PathBuf),
|
||||
|
|
@ -112,4 +114,7 @@ pub struct SignVerifyOpts<'scope> {
|
|||
/// Defaults to 1.
|
||||
#[builder(default = 1)]
|
||||
pub retry_count: u8,
|
||||
|
||||
#[builder(default)]
|
||||
pub platform: Platform,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue