ComposeService

Struct ComposeService 

Source
pub struct ComposeService {
Show 51 fields pub image: Option<String>, pub build: Option<ComposeBuild>, pub container_name: Option<String>, pub command: Option<StringOrList>, pub entrypoint: Option<StringOrList>, pub environment: Option<EnvironmentVars>, pub env_file: Option<StringOrList>, pub ports: Option<Vec<PortMapping>>, pub volumes: Option<Vec<VolumeMount>>, pub networks: Option<ServiceNetworks>, pub depends_on: Option<DependsOn>, pub restart: Option<String>, pub working_dir: Option<String>, pub user: Option<String>, pub labels: Option<Labels>, pub extra_hosts: Option<Vec<String>>, pub dns: Option<StringOrList>, pub hostname: Option<String>, pub domainname: Option<String>, pub privileged: Option<bool>, pub read_only: Option<bool>, pub stdin_open: Option<bool>, pub tty: Option<bool>, pub stop_signal: Option<String>, pub stop_grace_period: Option<String>, pub healthcheck: Option<HealthCheck>, pub logging: Option<LoggingConfig>, pub deploy: Option<DeployConfig>, pub secrets: Option<Vec<ServiceSecret>>, pub configs: Option<Vec<ServiceConfig>>, pub cap_add: Option<Vec<String>>, pub cap_drop: Option<Vec<String>>, pub devices: Option<Vec<String>>, pub expose: Option<Vec<StringOrInt>>, pub links: Option<Vec<String>>, pub network_mode: Option<String>, pub pid: Option<String>, pub ipc: Option<String>, pub security_opt: Option<Vec<String>>, pub sysctls: Option<HashMap<String, StringOrInt>>, pub ulimits: Option<HashMap<String, Ulimit>>, pub tmpfs: Option<StringOrList>, pub init: Option<bool>, pub profiles: Option<Vec<String>>, pub platform: Option<String>, pub pull_policy: Option<String>, pub scale: Option<i32>, pub mem_limit: Option<StringOrInt>, pub mem_reservation: Option<StringOrInt>, pub cpus: Option<f64>, pub shm_size: Option<StringOrInt>,
}
Expand description

Service definition in a Compose file.

Fields§

§image: Option<String>

Image to use for this service

§build: Option<ComposeBuild>

Build configuration

§container_name: Option<String>

Container name override

§command: Option<StringOrList>

Command to run

§entrypoint: Option<StringOrList>

Entrypoint override

§environment: Option<EnvironmentVars>

Environment variables

§env_file: Option<StringOrList>

Environment file(s)

§ports: Option<Vec<PortMapping>>

Port mappings

§volumes: Option<Vec<VolumeMount>>

Volume mounts

§networks: Option<ServiceNetworks>

Network connections

§depends_on: Option<DependsOn>

Service dependencies

§restart: Option<String>

Restart policy

§working_dir: Option<String>

Working directory

§user: Option<String>

User to run as

§labels: Option<Labels>

Labels

§extra_hosts: Option<Vec<String>>

Extra hosts

§dns: Option<StringOrList>

DNS servers

§hostname: Option<String>

Hostname

§domainname: Option<String>

Domain name

§privileged: Option<bool>

Privileged mode

§read_only: Option<bool>

Read-only root filesystem

§stdin_open: Option<bool>

Stdin open

§tty: Option<bool>

TTY allocation

§stop_signal: Option<String>

Stop signal

§stop_grace_period: Option<String>

Stop grace period

§healthcheck: Option<HealthCheck>

Health check configuration

§logging: Option<LoggingConfig>

Logging configuration

§deploy: Option<DeployConfig>

Deploy configuration (Swarm mode)

§secrets: Option<Vec<ServiceSecret>>

Secrets to expose

§configs: Option<Vec<ServiceConfig>>

Configs to expose

§cap_add: Option<Vec<String>>

Capabilities to add

§cap_drop: Option<Vec<String>>

Capabilities to drop

§devices: Option<Vec<String>>

Devices to map

§expose: Option<Vec<StringOrInt>>

Expose ports (not published)

§links: Option<Vec<String>>

Links (legacy)

§network_mode: Option<String>

Network mode

§pid: Option<String>

PID mode

§ipc: Option<String>

IPC mode

§security_opt: Option<Vec<String>>

Security options

§sysctls: Option<HashMap<String, StringOrInt>>

Sysctls

§ulimits: Option<HashMap<String, Ulimit>>

Ulimits

§tmpfs: Option<StringOrList>

tmpfs mounts

§init: Option<bool>

Init process

§profiles: Option<Vec<String>>

Profiles this service belongs to

§platform: Option<String>

Platform specification

§pull_policy: Option<String>

Pull policy

§scale: Option<i32>

Scale (number of replicas)

§mem_limit: Option<StringOrInt>

Memory limit

§mem_reservation: Option<StringOrInt>

Memory reservation

§cpus: Option<f64>

CPU count

§shm_size: Option<StringOrInt>

Shared memory size

Trait Implementations§

Source§

impl Clone for ComposeService

Source§

fn clone(&self) -> ComposeService

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 ComposeService

Source§

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

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

impl Default for ComposeService

Source§

fn default() -> ComposeService

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

impl<'de> Deserialize<'de> for ComposeService

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 Serialize for ComposeService

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

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> Ungil for T
where T: Send,