Skip to main content

AdvancedBuildStep

Struct AdvancedBuildStep 

Source
pub struct AdvancedBuildStep {
Show 24 fields pub context: Option<String>, pub additional_contexts: ListOrMap, pub dockerfile: Option<String>, pub dockerfile_inline: Option<String>, pub args: Option<ListOrMap>, pub cache_from: Vec<String>, pub cache_to: Vec<String>, pub entitlements: BTreeSet<String>, pub extra_hosts: Option<ExtraHosts>, pub isolation: Option<String>, pub labels: ListOrMap, pub network: Option<String>, pub no_cache: Option<bool>, pub platforms: BTreeSet<String>, pub privileged: Option<bool>, pub provenance: Option<bool>, pub pull: Option<bool>, pub sbom: Option<bool>, pub secrets: BTreeSet<ServiceConfigOrSecret>, pub ssh: ListOrMap, pub shm_size: Option<StringOrNum>, pub tags: BTreeSet<String>, pub target: Option<String>, pub ulimits: BTreeMap<String, Ulimit>,
}
Expand description

Specifies the build configuration for creating a container image from source, as defined in the Compose Build Specification.

Fields§

§context: Option<String>

Defines either a path to a directory containing a Dockerfile, or a URL to a Git repository.

When the value supplied is a relative path, it is interpreted as relative to the project directory. Compose warns you about the absolute path used to define the build context as those prevent the Compose file from being portable.

See more: https://docs.docker.com/reference/compose-file/build/#context

§additional_contexts: ListOrMap

Requires: Docker Compose 2.17.0 and later

Defines a list of named contexts the image builder should use during image build. Can be a mapping or a list. See more: https://docs.docker.com/reference/compose-file/build/#additional_contexts

§dockerfile: Option<String>

Sets an alternate Dockerfile. A relative path is resolved from the build context. Compose warns you about the absolute path used to define the Dockerfile as it prevents Compose files from being portable.

When set, dockerfile_inline attribute is not allowed and Compose rejects any Compose file having both set.

§dockerfile_inline: Option<String>

Requires: Docker Compose 2.17.0 and later

dockerfile_inline defines the Dockerfile content as an inlined string in a Compose file. When set, the dockerfile attribute is not allowed and Compose rejects any Compose file having both set.

§args: Option<ListOrMap>

Define build arguments, that is Dockerfile ARG values.

Cache location syntax follows the global format [NAME|type=TYPE[,KEY=VALUE]]. Simple NAME is actually a shortcut notation for type=registry,ref=NAME.

See more: https://docs.docker.com/reference/compose-file/build/#args

§cache_from: Vec<String>

Defines a list of sources the image builder should use for cache resolution.

See more: https://docs.docker.com/reference/compose-file/build/#cache_from

§cache_to: Vec<String>

Defines a list of export locations to be used to share build cache with future builds.

Cache location syntax follows the global format [NAME|type=TYPE[,KEY=VALUE]]. Simple NAME is actually a shortcut notation for type=registry,ref=NAME.

See more: https://docs.docker.com/reference/compose-file/build/#cache_to

§entitlements: BTreeSet<String>

Requires: Docker Compose 2.27.1 and later

Defines extra privileged entitlements to be allowed during the build.

§extra_hosts: Option<ExtraHosts>

Adds hostname mappings at build-time. Use the same syntax as extra_hosts.

§isolation: Option<String>

Specifies a build’s container isolation technology. Supported values are platform specific.

§labels: ListOrMap

Add metadata to the resulting image. Can be set either as an array or a map.

It’s recommended that you use reverse-DNS notation to prevent your labels from conflicting with other software.

§network: Option<String>

Network mode to use for the build. Options include ‘default’, ‘none’, ‘host’, or a network name.

See more: https://docs.docker.com/reference/compose-file/build/#network

§no_cache: Option<bool>

Disables image builder cache and enforces a full rebuild from source for all image layers. This only applies to layers declared in the Dockerfile, referenced images can be retrieved from local image store whenever tag has been updated on registry (see pull).

§platforms: BTreeSet<String>

Defines a list of target platforms.

See more: https://docs.docker.com/reference/compose-file/build/#platforms

§privileged: Option<bool>

Requires: Docker Compose 2.15.0 and later

Configures the service image to build with elevated privileges. Support and actual impacts are platform specific.

§provenance: Option<bool>

Requires: Docker Compose 2.39.0 and later

Configures the builder to add a provenance attestation to the published image.

The value can be either a boolean to enable/disable provenance attestation, or a key=value string to set provenance configuration. You can use this to select the level of detail to be included in the provenance attestation by setting the mode parameter.

§pull: Option<bool>

Requires the image builder to pull referenced images (FROM Dockerfile directive), even if those are already available in the local image store.

§sbom: Option<bool>

Requires: Docker Compose 2.39.0 and later

Configures the builder to add a provenance attestation to the published image.

See more: https://docs.docker.com/reference/compose-file/build/#sbom

§secrets: BTreeSet<ServiceConfigOrSecret>

Grants access to sensitive data defined by secrets on a per-service build basis.

See more: https://docs.docker.com/reference/compose-file/build/#secrets

§ssh: ListOrMap

SSH agent socket or keys to expose to the build. Format is either a string or a list of ‘default|[=|[,]]’.

See more: https://docs.docker.com/reference/compose-file/build/#ssh

§shm_size: Option<StringOrNum>

Size of /dev/shm for the build container. A string value can use suffix like ‘2g’ for 2 gigabytes.

See more: https://docs.docker.com/reference/compose-file/build/#shm_size

§tags: BTreeSet<String>

Defines a list of tag mappings that must be associated to the build image. This list comes in addition to the image property defined in the service section.

§target: Option<String>

Defines the stage to build as defined inside a multi-stage Dockerfile.

§ulimits: BTreeMap<String, Ulimit>

Requires: Docker Compose 2.23.1 and later

ulimits overrides the default ulimits for a container. It’s specified either as an integer for a single limit or as mapping for soft/hard limits.

See more: https://docs.docker.com/reference/compose-file/build/#ulimits

Trait Implementations§

Source§

impl Clone for AdvancedBuildStep

Source§

fn clone(&self) -> AdvancedBuildStep

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AdvancedBuildStep

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AdvancedBuildStep

Source§

fn default() -> AdvancedBuildStep

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for AdvancedBuildStep

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Merge for AdvancedBuildStep

Source§

fn merge(&mut self, other: Self)

Source§

impl PartialEq for AdvancedBuildStep

Source§

fn eq(&self, other: &AdvancedBuildStep) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for AdvancedBuildStep

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for AdvancedBuildStep

Source§

impl StructuralPartialEq for AdvancedBuildStep

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,