pub struct ContainerSpec {
pub name: String,
pub image: String,
pub cmd: Vec<String>,
pub env: Vec<String>,
pub labels: HashMap<String, String>,
pub exposed_ports: Vec<u16>,
pub network: Option<String>,
}Expand description
Docker container creation parameters used by DockerClient.
Fields§
§name: StringContainer name.
image: StringDocker image reference.
cmd: Vec<String>Container command arguments.
env: Vec<String>Environment variables.
labels: HashMap<String, String>Docker labels.
exposed_ports: Vec<u16>Container TCP ports to publish on random host ports.
network: Option<String>Optional Docker network mode/name.
Implementations§
Source§impl ContainerSpec
impl ContainerSpec
Sourcepub fn new(name: impl Into<String>, image: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, image: impl Into<String>) -> Self
Create a container spec with no command, env, labels, ports, or network.
Sourcepub fn expose_port(self, port: u16) -> Self
pub fn expose_port(self, port: u16) -> Self
Publish one container TCP port on a random host port.
Sourcepub fn expose_ports<I>(self, ports: I) -> Selfwhere
I: IntoIterator<Item = u16>,
pub fn expose_ports<I>(self, ports: I) -> Selfwhere
I: IntoIterator<Item = u16>,
Publish multiple container TCP ports on random host ports.
Trait Implementations§
Source§impl Clone for ContainerSpec
impl Clone for ContainerSpec
Source§fn clone(&self) -> ContainerSpec
fn clone(&self) -> ContainerSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContainerSpec
impl Debug for ContainerSpec
Source§impl<'de> Deserialize<'de> for ContainerSpec
impl<'de> Deserialize<'de> for ContainerSpec
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
Source§impl PartialEq for ContainerSpec
impl PartialEq for ContainerSpec
Source§impl Serialize for ContainerSpec
impl Serialize for ContainerSpec
impl Eq for ContainerSpec
impl StructuralPartialEq for ContainerSpec
Auto Trait Implementations§
impl Freeze for ContainerSpec
impl RefUnwindSafe for ContainerSpec
impl Send for ContainerSpec
impl Sync for ContainerSpec
impl Unpin for ContainerSpec
impl UnsafeUnpin for ContainerSpec
impl UnwindSafe for ContainerSpec
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<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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request