The `service create` and `service update` commands do not support all options th…at `docker run` / `docker create` supports. Some options are not implemented yet, whereas other options may either _not_ be implemented (because they don't make sense in the context of a _service_, or are not portable / cross platform).
We should add more options for services, _however_ instead of blindly copying every option, we should make sure the options are implemented properly, which may require using different names for the options and/or different kind of values.
I tried to create an overview of all options on `docker run`, and to match them with the `docker service create` options we currently have; I may have missed some, or made the wrong "translation", so input is welcome here
| Status | Issue | `docker run` | `docker service` | Notes |
|:----------------------|:-----------------------------------------------|:-----------------------------|:---------------------------------------------------------------------------------------|:---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| :white_check_mark: | #27902 | `--add-host` | | |
| :question: | #27552 (for `exec`) | `-a, --attach` | n/a | ~~does not apply to _services_, as there are multiple containers backing it~~ There may be usecases for this, but design/implementation needs discussion |
| | | `--blkio-weight` | | |
| | | `--blkio-weight-device` | | |
| :white_check_mark: | #25885 | `--cap-add` | | ~docker/cli#2663~ docker/cli#2687 docker/cli#2709 |
| :white_check_mark: | #25885 | `--cap-drop` | | ~docker/cli#2663~ docker/cli#2687 docker/cli#2709 |
| | | `--cgroup-parent` | | |
| :x: | | `--cidfile` | | does not apply to _services_, as there are multiple containers backing it |
| :question: | | `--cpu-percent` | | |
| :white_check_mark: | | `--cpu-period` | `--limit-cpu` | `--limit-cpu` sets a combination of "cpu period" and "cpu quota" see #27958 for the `docker run` implementation |
| :white_check_mark: | | `--cpu-quota` | `--limit-cpu` | `--limit-cpu` sets a combination of "cpu period" and "cpu quota" see #27958 for the `docker run` implementation |
| :question: | | `--cpu-rt-period` | | |
| :question: | | `--cpu-rt-runtime` | | |
| :question: | | `-c, --cpu-shares` | | |
| :white_check_mark: | | `--cpus` | `--limit-cpu` | `--limit-cpu` sets a combination of "cpu period" and "cpu quota" see #27958 for the `docker run` implementation |
| :question: | #30477 | `--cpuset-cpus` | | |
| :question: | | `--cpuset-mems` | | |
| :white_check_mark: | | `-d, --detach` | | `-d` is the default |
| :x: | | `--detach-keys` | | No interactive services, so not needed |
| :question: | #24865 / docker/swarmkit#1244 | `--device` | | |
| :question: | | `--device-cgroup-rule` | | devices are host specific, so may not make sense:question: |
| :question: | #32602 | `--device-read-bps` | | devices are host specific, so may not make sense:question: |
| :question: | #32602 | `--device-read-iops` | | devices are host specific, so may not make sense:question: |
| :question: | #32602 | `--device-write-bps` | | devices are host specific, so may not make sense:question: |
| :question: | #32602 | `--device-write-iops` | | devices are host specific, so may not make sense:question: |
| | | `--disable-content-trust` | | |
| :white_check_mark: | #24391 | `--dns` | | PR #27567 |
| :white_check_mark: | #24391 | `--dns-option` | `--dns-option`, `--dns-option-add`, `--dns-option-rm` | PR #27567 |
| :white_check_mark: | #24391 | `--dns-search` | `--dns-search, `--dns-search-add, `--dns-search-rm` | PR #27567 |
| :question: | #29171 | `--entrypoint` | | |
| :white_check_mark: | | `-e, --env` | `-e, --env` | |
| :white_check_mark: | #24712 #31595 | `--env-file` | | PR #24844 |
| | | `--expose` | | |
| | | `--gpus` | | |
| :white_check_mark: | #25317 | `--group-add` | `--group` | |
| :white_check_mark: | #27369 | `--health-cmd` | | |
| :white_check_mark: | #27369 | `--health-interval duration` | | |
| :white_check_mark: | #27369 | `--health-retries` | | |
| :question: | | `--health-start-period` | | |
| :white_check_mark: | #27369 | `--health-timeout duration` | | |
| :white_check_mark: | #24877 | `-h, --hostname` | | |
| :white_check_mark: | #34529, docker/cli#51 #34639 | `--init` | `--init` | PR docker/swarmkit#2350, docker/swarmkit#2652, moby/moby#36895, moby/moby#37183, docker/cli#1116, docker/cli#479, docker/cli#1129 |
| :question: | #32300 | `-i, --interactive` | | ~~does not apply to _services_, as there are multiple containers backing it~~ There may be usecases for this, but design/implementation needs discussion |
| :question: | #24170 / #29816 | `--ip` | | ~~does not apply to _services_, as there are multiple containers backing it.~~ Update: possibly useful to set the VIP |
| :question: | #24170 / #29816 | `--ip6` | | ~~does not apply to _services_, as there are multiple containers backing it.~~ Update: possibly useful to set the VIP |
| | | `--ipc` | | |
| :white_check_mark: | #31616, docker/cli#414 | `--isolation` | | PR #34424, docker/cli#426, docker/swarmkit#2342 |
| :x: | | `--kernel-memory` | | Feature is deprecated in the kernel; see #41254, #41252 |
| :white_check_mark: | | `-l, --label` | `--container-label` | |
| | | `--label-file` | | |
| :x: | | `--link` | | will be resolved through `--network-alias`:question: |
| :x: | | `--link-local-ip` | | does not apply to _services_, as there are multiple containers backing it |
| :white_check_mark: | | `--log-driver` | `--log-driver` | |
| :white_check_mark: | | `--log-opt` | `--log-opt` | |
| :question: | #31092 | `--mac-address` | | does not apply to _services_, as there are multiple containers backing it |
| :white_check_mark: | | `-m, --memory` | `--limit-memory` | |
| :white_check_mark: | | `--memory-reservation` | `--reserve-memory` | |
| :construction: | #34654 | `--memory-swap` | | PR: https://github.com/moby/moby/pull/37872 |
| :construction: | #34654 | `--memory-swappiness` | | PR: https://github.com/moby/moby/pull/37872 |
| :white_check_mark: | | `--mount` | `--mount`, `--mount-add`, `--mount-rm` | |
| :white_square_button: | | `--name` | | NOTE: `--name` sets the _service_ name, not the container's name |
| :white_check_mark: | #28573 | `--network` | `--network` | `host` networking (see #25873) added through #32981. |
| :white_check_mark: | #28247 | -- | `--network-add`/`--network-rm` are added in docker 17.05 | docker/swarmkit#1029 |
| | #24787 | `--network-alias` | | |
| :white_check_mark: | | `--no-healthcheck` | | |
| | | `--oom-kill-disable` | | |
| :white_square_button: | #34703 | `--oom-score-adj` | | swarmkit PR: docker/swarmkit#2371 |
| | docker/swarmkit#1605 | `--pid` | | |
| :white_check_mark: | #28618 | `--pids-limit` | | PR: #39882 swarmkit PR: docker/swarmkit#2415 (vendored: #35326) |
| :question: | | `--platform` | | |
| | #24862 / docker/swarmkit#1030 | `--privileged` | | docker/swarmkit#1722 |
| :white_check_mark: | | `-p, --publish` | `-p, --publish` | NOTE: does not support `<ip-address>` (#26696, #32299) |
| :x: | | `-P, --publish-all` | | when defining a service; explicitly define ports to publish |
| :white_check_mark: | #30162 | `--read-only` | | #29972 |
| :white_check_mark: | | `--restart` | `--restart-condition`, `--restart-delay`, `--restart-max-attempts`, `--restart-window` | |
| :x: | | `--rm` | | SwarmKit keeps old tasks (containers) around, but removes them, based on `--task-history-limit` |
| | | `--runtime` | | |
| | ~#25209~ -> #41371 | `--security-opt` | `--credential-spec` (#32339) is equivalent for `--security opt credentialspec=...` | SELinux can be set through API (#32339) |
| :question: | #26714 | `--shm-size` | Possible through `--mount type=tmpfs,target=/dev/shm` | |
| | | `--sig-proxy` | | |
| :white_check_mark: | #25696 | `--stop-signal` | | PR #30754 |
| :white_check_mark: | | `--stop-timeout` | `--stop-grace-period` | New in 1.13 (see #22566) |
| | #28619 | `--storage-opt` | | |
| :white_check_mark: | #25209, #31961, moby/libentitlement#35 | `--sysctl` | | PR #37701, docker/swarmkit#2729, docker/cli#1754 |
| :white_check_mark: | | `--tmpfs` | `--mount type=tmpfs` | |
| :white_check_mark: | #25644 | `-t, --tty` | | Implemented in SwarmKit docker/swarmkit#1370. Docker PR is #28076 |
| :white_check_mark: | #25209 | `--ulimit` | | PRs: docker/swarmkit#2967, #41284, ~docker/cli#2660~ docker/cli#2712 |
| :white_check_mark: | ~~#25304~~ | `-u, --user` | `-u, --user` | ~~Does not support group / gid~~ (see [#25304 (comment)](https://github.com/docker/docker/issues/25304#issuecomment-236881192)) |
| :question: | #37560 | `--userns` | | |
| | | `--uts` | | |
| :white_check_mark: | | `-v, --volume` | `--mount` | UX improvement needed (add `-v` flag?) |
| :white_check_mark: | | `--volume-driver` | `--mount` | UX improvement needed (add `-v` flag?) |
| :x: | | `--volumes-from` | | does not apply to _services_, as there are multiple containers backing it |
| :white_check_mark: | | `-w, --workdir` | `-w, --workdir` | |