CmdID / docker / docker service
docker service create
Create a new service Docker CLI reference
75 options Its page in the Docker CLI reference
Options
Show its 75 options
--cap-addAdd Linux capabilities--cap-dropDrop Linux capabilities--configSpecify configurations to expose to the service--constraintPlacement constraints--container-labelContainer labels--credential-specCredential spec for managed service account (Windows only)--detach, -dExit immediately instead of waiting for the service to converge--dns-optionSet DNS options--dns-searchSet custom DNS search domains--dnsSet custom DNS servers--endpoint-modeEndpoint mode (vip or dnsrr)--entrypointOverwrite the default ENTRYPOINT of the image--env, -eSet environment variables--env-fileRead in a file of environment variables--generic-resourceUser defined resources--groupSet one or more supplementary user groups for the container--health-cmdCommand to run to check health--health-intervalTime between running the check (ms\--health-retriesConsecutive failures needed to report unhealthy--health-start-intervalTime between running the check during the start period (ms\--health-start-periodStart period for the container to initialize before counting retries towards unstable (ms\--health-timeoutMaximum time to allow one check to run (ms\--hostSet one or more custom host-to-IP mappings (host:ip)--hostnameContainer hostname--initUse an init inside each service container to forward signals and reap processes--isolationService container isolation mode--label, -lService labels--limit-cpuLimit CPUs--limit-memoryLimit Memory--limit-pidsLimit maximum number of processes (default 0 = unlimited)--log-driverLogging driver for service--log-optLogging driver options--max-concurrentNumber of job tasks to run concurrently (default equal to --replicas)--memory-swapSwap Bytes (-1 for unlimited)--memory-swappinessTune memory swappiness (0-100), -1 to reset to default--modeService mode (replicated, global, replicated-job, global-job)--mountAttach a filesystem mount to the service--nameService name--networkNetwork attachments--no-healthcheckDisable any container-specified HEALTHCHECK--no-resolve-imageDo not query the registry to resolve image digest and supported platforms--oom-score-adjTune host's OOM preferences (-1000 to 1000)--placement-prefAdd a placement preference--publish, -pPublish a port as a node port--quiet, -qSuppress progress output--read-onlyMount the container's root filesystem as read only--replicas-max-per-nodeMaximum number of tasks per node (default 0 = unlimited)--replicasNumber of tasks--reserve-cpuReserve CPUs--reserve-memoryReserve Memory--restart-conditionRestart when condition is met (none, on-failure, any) (default any)--restart-delayDelay between restart attempts (ns\--restart-max-attemptsMaximum number of restarts before giving up--restart-windowWindow used to evaluate the restart policy (ns\--rollback-delayDelay between task rollbacks (ns\--rollback-failure-actionAction on rollback failure (pause, continue) (default pause)--rollback-max-failure-ratioFailure rate to tolerate during a rollback (default 0)--rollback-monitorDuration after each task rollback to monitor for failure (ns\--rollback-orderRollback order (start-first, stop-first) (default stop-first)--rollback-parallelismMaximum number of tasks rolled back simultaneously (0 to roll back all at once)--secretSpecify secrets to expose to the service--stop-grace-periodTime to wait before force killing a container (ns\--stop-signalSignal to stop the container--sysctlSysctl options--tty, -tAllocate a pseudo-TTY--ulimitUlimit options--update-delayDelay between updates (ns\--update-failure-actionAction on update failure (pause, continue, rollback) (default pause)--update-max-failure-ratioFailure rate to tolerate during an update (default 0)--update-monitorDuration after each task update to monitor for failure (ns\--update-orderUpdate order (start-first, stop-first) (default stop-first)--update-parallelismMaximum number of tasks updated simultaneously (0 to update all at once)--user, -uUsername or UID (format: <name\--with-registry-authSend registry authentication details to swarm agents--workdir, -wWorking directory inside the container