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<String, String>, 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<String, String>, pub links: Vec<RawOr<AliasedName>>, pub logging: Option<Logging>, pub network_mode: Option<RawOr<NetworkMode>>, pub networks: BTreeMap<String, NetworkInterface>, 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
build: Option<Build>
How to build an image for this service.
cap_add: Vec<RawOr<String>>
A list of capability names to grant to this container.
cap_drop: Vec<RawOr<String>>
A list of capability names to revoke from this container.
command: Option<CommandLine>
The command-line to run when launching the container.
cgroup_parent: Option<RawOr<String>>
The name of an optional parent cgroup. (Mysterious.)
container_name: Option<RawOr<String>>
An optional (global, non-scalable) container name.
devices: Vec<RawOr<AliasedName>>
A list of devices to map into this container.
TODO LOW: Add DevicePermissions and make both host and container mandatory.
depends_on: Vec<RawOr<String>>
A list of other containers to start first.
dns: Vec<RawOr<String>>
DNS servers.
dns_search: Vec<RawOr<String>>
Domains to search for hostnames.
tmpfs: Vec<RawOr<String>>
Locations to mount temporary file systems.
entrypoint: Option<CommandLine>
The entrypoint for the container (wraps command
, basically).
env_files: Vec<RawOr<PathBuf>>
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: BTreeMap<String, String>
Environment variables and values to supply to the container.
expose: Vec<RawOr<String>>
Expose a list of ports to any containers that link to us.
extends: Option<Extends>
Extend another service, either in this file or another.
external_links: Vec<RawOr<AliasedName>>
Links to external containers.
extra_hosts: Vec<RawOr<HostMapping>>
Mappings for extra hosts in /etc/hosts.
image: Option<RawOr<Image>>
The name of the image to build or pull for this container.
labels: BTreeMap<String, String>
Docker labels for this container, specifying various sorts of custom metadata.
TODO MED: Deal with RawOr in deserialize_map_or_key_value_list.
links: Vec<RawOr<AliasedName>>
Links to other services in this file.
logging: Option<Logging>
Logging options for this container.
network_mode: Option<RawOr<NetworkMode>>
What networking mode should we use?
networks: BTreeMap<String, NetworkInterface>
Networks to which this container is attached.
pid: Option<RawOr<PidMode>>
What PID namespacing mode should we use?
ports: Vec<RawOr<PortMapping>>
What ports do we want to map to our host system?
security_opt: Vec<RawOr<String>>
Security options for AppArmor or SELinux.
stop_signal: Option<RawOr<String>>
The name of the Unix signal which will be sent to stop this container. Defaults to SIGTERM if not specified.
volumes: Vec<RawOr<VolumeMount>>
Volumes associated with this service.
volumes_from: Vec<RawOr<VolumesFrom>>
Other places to get volumes from.
volume_driver: Option<RawOr<String>>
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.
cpu_quota: Option<u32>
Limit the CFS CPU quota.
domainname: Option<RawOr<String>>
The domain name to use for this container.
hostname: Option<RawOr<String>>
The hostname to use for this container.
ipc: Option<RawOr<IpcMode>>
What IPC namespacing mode should we use?
mac_address: Option<RawOr<String>>
The MAC address to use for this container's network interface.
mem_limit: Option<RawOr<MemorySize>>
The maximum amount of memory which this container may use, in bytes.
memswap_limit: Option<RawOr<MemorySize>>
The maximum amount of swap space which this container may use, in bytes.
privileged: bool
The MAC address to use for this container's network interface.
restart: Option<RawOr<RestartMode>>
What should we do when the container exits?
shm_size: Option<RawOr<MemorySize>>
The amount of shared memory to allocate for this container, in bytes.
stdin_open: bool
Should STDIN be left open when running the container? Corresponds
to docker run -i
.
tty: bool
Should a TTY be be allocated for the container? Corresponds to
docker run -t
.
user: Option<RawOr<String>>
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?
working_dir: Option<RawOr<PathBuf>>
The working directory to use for this container.
Methods
impl Service
[src]
fn inline_all(&mut self, base: &Path) -> Result<(), Error>
Inline all our external resources, such as env_files
, looking up
paths relative to base
.
Trait Implementations
impl Default for Service
[src]
impl Eq for Service
[src]
impl PartialEq for Service
[src]
fn eq(&self, __arg_0: &Service) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Service) -> bool
This method tests for !=
.
impl Clone for Service
[src]
fn clone(&self) -> Service
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Service
[src]
impl InterpolateAll for Service
[src]
Recursive merge all fields in the structure.
fn interpolate_all(&mut self) -> Result<(), InterpolationError>
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.
fn merge_override(&self, ovr: &Self) -> Self
Given this value and an override value, merge the override value into this one, producing a new value. Read more