pub enum BuildConfig {
Context(String),
Config {Show 24 fields
context: Option<String>,
dockerfile: Option<String>,
dockerfile_inline: Option<String>,
args: EnvVars,
target: Option<String>,
cache_from: Vec<String>,
cache_to: Vec<String>,
labels: Labels,
shm_size: Option<String>,
network: Option<String>,
platforms: Vec<String>,
additional_contexts: HashMap<String, String>,
no_cache: Option<bool>,
pull: Option<bool>,
extra_hosts: Vec<String>,
tags: Vec<String>,
privileged: Option<bool>,
ssh: Vec<String>,
secrets: Vec<String>,
ulimits: IndexMap<String, UlimitConfig>,
isolation: Option<String>,
entitlements: Vec<String>,
provenance: Option<Value>,
sbom: Option<bool>,
},
}Expand description
Compose build: directive — either a bare context path or a full build-config block.
Variants§
Context(String)
Short form: a bare build context path.
Config
Long form: the full set of build options.
Fields
Image references to tag the built image with.
ulimits: IndexMap<String, UlimitConfig>Resource limits applied to the build container.
Implementations§
Source§impl BuildConfig
impl BuildConfig
Sourcepub fn context(&self) -> &str
pub fn context(&self) -> &str
Build context path.
In the long form, context is optional per the Compose Spec (v2.22+):
a build: block carrying only dockerfile_inline: has no context and
defaults to the project directory ..
Sourcepub fn dockerfile(&self) -> Option<&str>
pub fn dockerfile(&self) -> Option<&str>
Returns the Dockerfile path, if set.
Sourcepub fn extra_hosts(&self) -> &[String]
pub fn extra_hosts(&self) -> &[String]
Returns the extra host:ip mappings for the build.
Returns the image tags to apply to the built image.
Sourcepub fn cache_from(&self) -> &[String]
pub fn cache_from(&self) -> &[String]
Returns the cache sources for the build.
Sourcepub fn dockerfile_inline(&self) -> Option<&str>
pub fn dockerfile_inline(&self) -> Option<&str>
Returns the inline Dockerfile contents, if set.
Sourcepub fn secrets(&self) -> &[String]
pub fn secrets(&self) -> &[String]
build.secrets — names of top-level secrets exposed to the build.
Sourcepub fn additional_contexts(&self) -> Vec<(String, String)>
pub fn additional_contexts(&self) -> Vec<(String, String)>
build.additional_contexts — named extra build contexts (name -> source).
Trait Implementations§
Source§impl Clone for BuildConfig
impl Clone for BuildConfig
Source§fn clone(&self) -> BuildConfig
fn clone(&self) -> BuildConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more