pub enum RunMount {
Bind {
target: String,
source: Option<String>,
from: Option<String>,
readonly: bool,
},
Cache {
target: String,
id: Option<String>,
sharing: CacheSharing,
readonly: bool,
},
Tmpfs {
target: String,
size: Option<u64>,
},
Secret {
target: String,
id: String,
required: bool,
},
Ssh {
target: String,
id: Option<String>,
required: bool,
},
}Expand description
Mount types for RUN –mount
Variants§
Bind
Bind mount from build context or another stage
Cache
Cache mount for build caches (e.g., package managers)
Tmpfs
Tmpfs mount
Secret
Secret mount
Ssh
SSH mount for SSH agent forwarding
Implementations§
Source§impl RunMount
impl RunMount
Sourcepub fn to_buildah_arg(&self) -> String
pub fn to_buildah_arg(&self) -> String
Convert the mount specification to a buildah --mount argument string.
Returns a string in the format type=<type>,<option>=<value>,...
suitable for use with buildah run --mount=<result>.
§Examples
use zlayer_builder::dockerfile::{RunMount, CacheSharing};
let cache_mount = RunMount::Cache {
target: "/var/cache/apt".to_string(),
id: Some("apt-cache".to_string()),
sharing: CacheSharing::Shared,
readonly: false,
};
assert_eq!(
cache_mount.to_buildah_arg(),
"type=cache,target=/var/cache/apt,id=apt-cache,sharing=shared"
);Trait Implementations§
Source§impl<'de> Deserialize<'de> for RunMount
impl<'de> Deserialize<'de> for RunMount
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RunMount
impl StructuralPartialEq for RunMount
Auto Trait Implementations§
impl Freeze for RunMount
impl RefUnwindSafe for RunMount
impl Send for RunMount
impl Sync for RunMount
impl Unpin for RunMount
impl UnsafeUnpin for RunMount
impl UnwindSafe for RunMount
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more