Optional
buildEither a path to a folder in which a Docker build should be run to construct the image for this
Container, or a ContainerBuild object with more detailed build instructions. If image
is also specified, the
built container will be tagged with that name, but otherwise will get an auto-generated image name.
Optional
commandThe command line that is passed to the container. This parameter maps to
Cmd
in the Create a
container
section of the Docker Remote
API
and the COMMAND
parameter to docker run. For more
information about the Docker CMD
parameter, go to
https://docs.docker.com/engine/reference/builder/#cmd.
Optional
containersA collection of containers that will be deployed as part of this Service, if there are multiple.
Optional
cpuNumber of CPUs for the container to use. Maps to the Docker --cpus
option - see
https://docs.docker.com/engine/reference/commandline/run.
Optional
dockerA key/value map of labels to add to the container. This parameter maps to Labels in the Create a container section of the Docker Remote API and the --label option to docker run.
Optional
environmentOptional environment variables to set and make available to the container as it is running.
Optional
functionThe function code to use as the implementation of the contaner. If function
is specified,
neither image
nor build
are legal.
Optional
hostThe properties of the host where this service can run.
Optional
imageThe image to use for the container. If image
is specified, but not build
, the image will be
pulled from the Docker Hub. If image
and build
are specified, the image
controls the
resulting image tag for the build image that gets pushed.
Optional
memoryThe maximum amount of memory the container will be allowed to use. Maps to the Docker
--memory
option - see
https://docs.docker.com/engine/reference/commandline/run.
This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.
Optional
memoryThe amount of memory to reserve for the container, but the container will
be allowed to use more memory if it's available. At least one of
memory
and memoryReservation
must be specified. Maps to the Docker
--memory-reservation
option - see
https://docs.docker.com/engine/reference/commandline/run.
This should be supplied in MB. i.e. A value of 1024 would equal one gigabyte.
Optional
portsAn array of ports to publish from the container. Ports are exposed using the TCP protocol. If the [external]
flag is true, the port will be exposed to the Internet even if the service is running in a private network.
Maps to the Docker --publish
option - see
https://docs.docker.com/engine/reference/commandline/run.
Optional
replicasThe number of copies of this Service's containers to deploy and maintain
as part of the running service. Defaults to 1
.
Optional
volumesAn array of volume mounts, indicating a volume to mount and a path within
the container at which to mount the volume. Maps to the Docker
--volume
option - see
https://docs.docker.com/engine/reference/commandline/run.
Optional
waitDetermines whether the service should wait to fully transition to a new steady state on creation and updates. If set to false, the service may complete its deployment before it is fully ready to be used. Defaults to 'true'.
Generated using TypeDoc
The arguments to construct a Service object. These arguments may include container information, for simple single-container scenarios, or you may specify that information using the containers property. If a single container is specified in-line, it is implicitly given the name "default".