Usage (docker service...)
...create [OPTIONS] IMAGE [COMMAND] [ARG...]
...inspect [OPTIONS] SERVICE [SERVICE...]
...logs [OPTIONS] SERVICE|TASK
...ls [OPTIONS]
...ps [OPTIONS] SERVICE [SERVICE...]
--no-trunc Do not truncate output
...rm SERVICE [SERVICE...]
...rollback [OPTIONS] SERVICE
...scale SERVICE=REPLICAS [SERVICE=REPLICAS...]
...update [OPTIONS] SERVICE
|
docker service create and update
--constraint (-add / -rm) |
Placement constraints |
--container-label, (-add / -rm) |
Container labels |
--detach , -d |
Run detached |
--entrypoint |
Overwrite entrypoint |
--env , -e, --env-file, (-add / -rm) |
Environment variables |
--label , -l, (-add / -rm) |
Service labels |
--limit-cpu, --limit-memory |
Limit resources |
--mount, (-add / -rm) |
Volumes |
--name (create only) |
Service name |
--network, (-add / -rm) |
Network attachments |
--publish , -p, (-add / -rm) |
Publish a port as a node port |
--replicas |
Number of tasks |
--replicas-max-per-node |
default=0 |
--reserve-cpu, --reserve-memory |
Reserve resources |
--secret, (-add / -rm) |
Secrets attachments |
--stop-grace-period |
Time before force killing |
--stop-signal |
Signal to stop the container |
--user , -u |
Username or UID |
--workdir , -w |
Workdir |
options "-add / -rm" are for docker update only
|
|
--constraint
node.id |
node.id==2ivku8v2gvtg4 |
node.hostname |
node.hostname!=node-2 |
node.role |
node.role==manager |
node.labels |
node.labels.security==high |
engine.labels |
engine.labels.operatingsystem==ubuntu 14.04 |
--mount
type |
volume, bind, tmpfs |
src or source |
dst or destination or target |
readonly or ro |
true or 1 or no value / false or 0 |
--restart
-condition |
“none”|”on-failure”|”any”, default “any” |
-delay |
between restart attempts, default 5s |
-max-attempts |
before giving up |
-window |
Window used to evaluate |
--rollback / --update
no option |
Rollback to previous specification (update only) |
-delay |
between task rollbacks/updates, default=0s |
-failure-action |
“pause”|”continue"|"rollback” ,default=“pause” |
-max-failure-ratio |
default 0 |
-monitor |
default 5s |
-order |
“start-first”|”stop-first”, default=“stop-first” |
-parallelism |
0 to rollback/update all at once |
|