mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit f565bc7ec9
)
2.9 KiB
2.9 KiB
Warning: this command is part of the Swarm management feature introduced in Docker 1.12, and might be subject to non backward-compatible changes.
service update
Usage: docker service update [OPTIONS] SERVICE
Update a service
Options:
--arg value Service command args (default [])
--command value Service command (default [])
--constraint value Placement constraints (default [])
--endpoint-mode string Endpoint mode(Valid values: VIP, DNSRR)
-e, --env value Set environment variables (default [])
--help Print usage
--image string Service image tag
-l, --label value Service labels (default [])
--limit-cpu value Limit CPUs (default 0.000)
--limit-memory value Limit Memory (default 0 B)
--mode string Service mode (replicated or global) (default "replicated")
-m, --mount value Attach a mount to the service
--name string Service name
--network value Network attachments (default [])
-p, --publish value Publish a port as a node port (default [])
--replicas value Number of tasks (default none)
--reserve-cpu value Reserve CPUs (default 0.000)
--reserve-memory value Reserve Memory (default 0 B)
--restart-condition string Restart when condition is met (none, on_failure, or any)
--restart-delay value Delay between restart attempts (default none)
--restart-max-attempts value Maximum number of restarts before giving up (default none)
--restart-window value Window used to evalulate the restart policy (default none)
--stop-grace-period value Time to wait before force killing a container (default none)
--update-delay duration Delay between updates
--update-parallelism uint Maximum number of tasks updated simultaneously
-u, --user string Username or UID
-w, --workdir string Working directory inside the container
Updates a service as described by the specified parameters. This command has to be run targeting a manager node.
The parameters are the same as docker service create
. Please look at the description there
for further information.
Examples
Update a service
$ docker service update --limit-cpu 2 redis