Struct docker_compose::v2::Service [] [src]

pub struct Service {
    pub build: Option<Build>,
    pub cap_add: Vec<RawOr<String>>,
    pub cap_drop: Vec<RawOr<String>>,
    pub command: Option<CommandLine>,
    pub cgroup_parent: Option<RawOr<String>>,
    pub container_name: Option<RawOr<String>>,
    pub devices: Vec<RawOr<AliasedName>>,
    pub depends_on: Vec<RawOr<String>>,
    pub dns: Vec<RawOr<String>>,
    pub dns_search: Vec<RawOr<String>>,
    pub tmpfs: Vec<RawOr<String>>,
    pub entrypoint: Option<CommandLine>,
    pub env_files: Vec<RawOr<PathBuf>>,
    pub environment: BTreeMap<StringString>,
    pub expose: Vec<RawOr<String>>,
    pub extends: Option<Extends>,
    pub external_links: Vec<RawOr<AliasedName>>,
    pub extra_hosts: Vec<RawOr<HostMapping>>,
    pub image: Option<RawOr<Image>>,
    pub labels: BTreeMap<StringString>,
    pub links: Vec<RawOr<AliasedName>>,
    pub logging: Option<Logging>,
    pub network_mode: Option<RawOr<NetworkMode>>,
    pub networks: BTreeMap<StringNetworkInterface>,
    pub pid: Option<RawOr<PidMode>>,
    pub ports: Vec<RawOr<PortMapping>>,
    pub security_opt: Vec<RawOr<String>>,
    pub stop_signal: Option<RawOr<String>>,
    pub volumes: Vec<RawOr<VolumeMount>>,
    pub volumes_from: Vec<RawOr<VolumesFrom>>,
    pub volume_driver: Option<RawOr<String>>,
    pub cpu_shares: Option<u32>,
    pub cpu_quota: Option<u32>,
    pub domainname: Option<RawOr<String>>,
    pub hostname: Option<RawOr<String>>,
    pub ipc: Option<RawOr<IpcMode>>,
    pub mac_address: Option<RawOr<String>>,
    pub mem_limit: Option<RawOr<MemorySize>>,
    pub memswap_limit: Option<RawOr<MemorySize>>,
    pub privileged: bool,
    pub restart: Option<RawOr<RestartMode>>,
    pub shm_size: Option<RawOr<MemorySize>>,
    pub stdin_open: bool,
    pub tty: bool,
    pub user: Option<RawOr<String>>,
    pub working_dir: Option<RawOr<PathBuf>>,
    // some fields omitted
}

A service which will be managed by docker-compose.

Fields

How to build an image for this service.

A list of capability names to grant to this container.

A list of capability names to revoke from this container.

The command-line to run when launching the container.

The name of an optional parent cgroup. (Mysterious.)

An optional (global, non-scalable) container name.

A list of devices to map into this container.

TODO LOW: Add DevicePermissions and make both host and container mandatory.

A list of other containers to start first.

DNS servers.

Domains to search for hostnames.

Locations to mount temporary file systems.

The entrypoint for the container (wraps command, basically).

Environment files used to supply variables to the container. Note that this is env_file in the underlying Docker format, but the singular form looks weird at the API level.

Environment variables and values to supply to the container.

Expose a list of ports to any containers that link to us.

Extend another service, either in this file or another.

Links to external containers.

Mappings for extra hosts in /etc/hosts.

The name of the image to build or pull for this container.

Docker labels for this container, specifying various sorts of custom metadata.

TODO MED: Deal with RawOr in deserialize_map_or_key_value_list.

Links to other services in this file.

Logging options for this container.

What networking mode should we use?

Networks to which this container is attached.

What PID namespacing mode should we use?

What ports do we want to map to our host system?

Security options for AppArmor or SELinux.

The name of the Unix signal which will be sent to stop this container. Defaults to SIGTERM if not specified.

Volumes associated with this service.

Other places to get volumes from.

This will only apply to volumes with no host path and no mapping to a volume declared under the volumes key at the top level of this file.

The relative number of CPU shares to give to this container.

Limit the CFS CPU quota.

The domain name to use for this container.

The hostname to use for this container.

What IPC namespacing mode should we use?

The MAC address to use for this container's network interface.

The maximum amount of memory which this container may use, in bytes.

The maximum amount of swap space which this container may use, in bytes.

The MAC address to use for this container's network interface.

What should we do when the container exits?

The amount of shared memory to allocate for this container, in bytes.

Should STDIN be left open when running the container? Corresponds to docker run -i.

Should a TTY be be allocated for the container? Corresponds to docker run -t.

The user name (or UID) of the user under which to execute the container's command. May optionally be followed by :group or :gid to specific the group or group ID.

TODO LOW: Parse out optional group field separately?

The working directory to use for this container.

Methods

impl Service
[src]

Inline all our external resources, such as env_files, looking up paths relative to base.

Trait Implementations

impl Default for Service
[src]

Returns the "default value" for a type. Read more

impl Eq for Service
[src]

impl PartialEq for Service
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Clone for Service
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Service
[src]

Formats the value using the given formatter.

impl InterpolateAll for Service
[src]

Recursive merge all fields in the structure.

Recursively walk over this type, interpolating all RawOr values containing references to the environment. The default implementation leaves a value unchanged. Read more

impl MergeOverride for Service
[src]

Recursive merge all fields in the structure.

Given this value and an override value, merge the override value into this one, producing a new value. Read more