Struct ContainerNetworkConfig

Source
pub struct ContainerNetworkConfig {
Show 13 fields pub networks: Option<HashMap<String, PerNetworkOptions>>, pub cni_networks: Option<Vec<String>>, pub dns_option: Option<Vec<String>>, pub dns_search: Option<Vec<String>>, pub dns_server: Option<Vec<String>>, pub expose: Option<Value>, pub hostadd: Option<Vec<String>>, pub netns: Option<Namespace>, pub network_options: Option<HashMap<String, Vec<String>>>, pub portmappings: Option<Vec<PortMapping>>, pub publish_image_ports: Option<bool>, pub use_image_hosts: Option<bool>, pub use_image_resolve_conf: Option<bool>,
}
Expand description

ContainerNetworkConfig contains information on a container’s network configuration.

Fields§

§networks: Option<HashMap<String, PerNetworkOptions>>

Map of networks names or ids that the container should join. You can request additional settings for each network, you can set network aliases, static ips, static mac address and the network interface name for this container on the specific network. If the map is empty and the bridge network mode is set the container will be joined to the default network.

§cni_networks: Option<Vec<String>>

CNINetworks is a list of CNI networks to join the container to. If this list is empty, the default CNI network will be joined instead. If at least one entry is present, we will not join the default network (unless it is part of this list). Only available if NetNS is set to bridge. Optional. Deprecated: as of podman 4.0 use “Networks” instead.

§dns_option: Option<Vec<String>>

DNSOptions is a set of DNS options that will be used in the container’s resolv.conf, replacing the host’s DNS options which are used by default. Conflicts with UseImageResolvConf. Optional.

§dns_search: Option<Vec<String>>

DNSSearch is a set of DNS search domains that will be used in the container’s resolv.conf, replacing the host’s DNS search domains which are used by default. Conflicts with UseImageResolvConf. Optional.

§dns_server: Option<Vec<String>>

DNSServers is a set of DNS servers that will be used in the container’s resolv.conf, replacing the host’s DNS Servers which are used by default. Conflicts with UseImageResolvConf. Optional.

§expose: Option<Value>

Expose is a number of ports that will be forwarded to the container if PublishExposedPorts is set. Expose is a map of uint16 (port number) to a string representing protocol i.e map[uint16]string. Allowed protocols are “tcp”, “udp”, and “sctp”, or some combination of the three separated by commas. If protocol is set to “” we will assume TCP. Only available if NetNS is set to Bridge or Slirp, and PublishExposedPorts is set. Optional.

§hostadd: Option<Vec<String>>

HostAdd is a set of hosts which will be added to the container’s etc/hosts file. Conflicts with UseImageHosts. Optional.

§netns: Option<Namespace>§network_options: Option<HashMap<String, Vec<String>>>

NetworkOptions are additional options for each network Optional.

§portmappings: Option<Vec<PortMapping>>

PortBindings is a set of ports to map into the container. Only available if NetNS is set to bridge or slirp. Optional.

§publish_image_ports: Option<bool>

PublishExposedPorts will publish ports specified in the image to random unused ports (guaranteed to be above 1024) on the host. This is based on ports set in Expose below, and any ports specified by the Image (if one is given). Only available if NetNS is set to Bridge or Slirp.

§use_image_hosts: Option<bool>

UseImageHosts indicates that /etc/hosts should not be managed by Podman, and instead sourced from the image. Conflicts with HostAdd. Do not set omitempty here, if this is false it should be set to not get the server default. Ideally this would be a pointer so we could differentiate between an explicitly false/true and unset (containers.conf default). However specgen is stable so we can not change this right now. TODO (5.0): change to pointer

§use_image_resolve_conf: Option<bool>

UseImageResolvConf indicates that resolv.conf should not be managed by Podman, but instead sourced from the image. Conflicts with DNSServer, DNSSearch, DNSOption.

Trait Implementations§

Source§

impl Clone for ContainerNetworkConfig

Source§

fn clone(&self) -> ContainerNetworkConfig

Returns a copy 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 ContainerNetworkConfig

Source§

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

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

impl<'de> Deserialize<'de> for ContainerNetworkConfig

Source§

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

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

impl PartialEq for ContainerNetworkConfig

Source§

fn eq(&self, other: &ContainerNetworkConfig) -> 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 ContainerNetworkConfig

Source§

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

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

impl StructuralPartialEq for ContainerNetworkConfig

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T