DOCKER(1)
π DOCKER(1) π
okay so bestie, welcome to the Docker User Manuals page DOCKER(1) β yes, the title is the whole vibe. sit down, grab a strawberry π, we're learning how to make a service and it's gonna be iconic.
β¨ NAME β¨
docker-service-create β create a new service π
πΈ SYNOPSIS πΈ
docker service create [OPTIONS] IMAGE [COMMAND] [ARG...]
like. OPTIONS, then your IMAGE, then optionally a COMMAND and some ARG...s. that's the whole shape of it. no cap. π«Ά
π¦ DESCRIPTION π¦
Create a new service. that's literally it. you say the word and a service is born. main character energy fr fr. π
π OPTIONS π
okay this is the long part and I am NOT skipping a single one, so buckle up. every flag, exactly as it is:
--cap-add=β add Linux capabilities. give the container a lil extra power πͺ--cap-drop=β drop Linux capabilities. take that power away π«--config=β specify configurations to expose to the service--constraint=β placement constraints (where things are allowed to land)--container-label=β container labels--credential-spec=β credential spec for managed service account (Windows only, iykyk)-d,--detach[=false]β exit immediately instead of waiting for the service to converge. bye, not waiting βοΈ--dns=β set custom DNS servers--dns-option=β set DNS options--dns-search=β set custom DNS search domains--endpoint-mode="vip"β endpoint mode (vip or dnsrr). default is"vip"--entrypoint=β overwrite the defaultENTRYPOINTof the image-e,--env=β set environment variables--env-file=β read in a file of environment variables--generic-resource=β user defined resources--group=β set one or more supplementary user groups for the container--health-cmd=""β command to run to check health. default is""--health-interval=β time between running the check (ms|s|m|h)--health-retries=0β consecutive failures needed to report unhealthy. default0--health-start-interval=β time between running the check during the start period (ms|s|m|h)--health-start-period=β start period for the container to initialize before counting retries towards unstable (ms|s|m|h)--health-timeout=β maximum time to allow one check to run (ms|s|m|h)--host=β set one or more custom host-to-IP mappings (host:ip)--hostname=""β container hostname. default""--init[=false]β use an init inside each service container to forward signals and reap processes--isolation=""β service container isolation mode. default""-l,--label=β service labels--limit-cpu=β limit CPUs--limit-memory=0β limit Memory. default0--limit-pids=0β limit maximum number of processes (default0= unlimited)--log-driver=""β logging driver for service. default""--log-opt=β logging driver options--max-concurrent=β number of job tasks to run concurrently (default equal to--replicas)--memory-swap=0β swap Bytes (-1for unlimited). default0--memory-swappiness=-1β tune memory swappiness (0-100),-1to reset to default. default-1--mode="replicated"β service mode ("replicated","global","replicated-job","global-job"). default"replicated"--mount=β attach a filesystem mount to the service--name=""β service name. default""--network=β network attachments--no-healthcheck[=false]β disable any container-specifiedHEALTHCHECK--no-resolve-image[=false]β do not query the registry to resolve image digest and supported platforms--oom-score-adj=0β tune host's OOM preferences (-1000to1000). default0--placement-pref=β add a placement preference-p,--publish=β publish a port as a node port-q,--quiet[=false]β suppress progress output. shhh π€«--read-only[=false]β mount the container's root filesystem as read only--replicas=β number of tasks--replicas-max-per-node=0β maximum number of tasks per node (default0= unlimited)--reserve-cpu=β reserve CPUs--reserve-memory=0β reserve Memory. default0--restart-condition=""β restart when condition is met ("none","on-failure","any") (default"any")--restart-delay=β delay between restart attempts (ns|us|ms|s|m|h) (default5s)--restart-max-attempts=β maximum number of restarts before giving up--restart-window=β window used to evaluate the restart policy (ns|us|ms|s|m|h)--rollback-delay=0sβ delay between task rollbacks (ns|us|ms|s|m|h) (default0s)--rollback-failure-action=""β action on rollback failure ("pause","continue") (default"pause")--rollback-max-failure-ratio=0β failure rate to tolerate during a rollback (default0)--rollback-monitor=0sβ duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default5s)--rollback-order=""β rollback order ("start-first","stop-first") (default"stop-first")--rollback-parallelism=1β maximum number of tasks rolled back simultaneously (0to roll back all at once). default1--secret=β specify secrets to expose to the service π€«--stop-grace-period=β time to wait before force killing a container (ns|us|ms|s|m|h) (default10s)--stop-signal=""β signal to stop the container. default""--sysctl=β Sysctl options-t,--tty[=false]β allocate a pseudo-TTY--ulimit=[]β ulimit options. default[]--update-delay=0sβ delay between updates (ns|us|ms|s|m|h) (default0s)--update-failure-action=""β action on update failure ("pause","continue","rollback") (default"pause")--update-max-failure-ratio=0β failure rate to tolerate during an update (default0)--update-monitor=0sβ duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default5s)--update-order=""β update order ("start-first","stop-first") (default"stop-first")--update-parallelism=1β maximum number of tasks updated simultaneously (0to update all at once). default1-u,--user=""β username or UID (format:[:]). default""--with-registry-auth[=false]β send registry authentication details to swarm agents-w,--workdir=""β working directory inside the container. default""
that's the whole list. all of it. every single one. we ate and left no crumbs. π₯
π SEE ALSO π
and that's the page bestie!! go forth and create services, you've got this π
cute lil sign-off: this one's from the Docker Community, dated Oct 2026, and it's page DOCKER(1) of the Docker User Manuals. periodt. π
β¨
π¦ where this page comes from
- alpine 3.24: docker-doc 29.9.2-r0 Β· Apache-2.0
- fedora 43: docker-cli 29.8.2-2.fc43
- fedora 43: docker-cli 29.9.2-2.fc43 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- fedora 44: docker-cli 29.8.2-2.fc44
- fedora 44: docker-cli 29.9.2-2.fc44 Β· Apache-2.0 AND BSD-2-Clause AND BSD-3-Clause AND MIT
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- opensuse-leap 16.0: docker 29.7.2_ce-160000.8.1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms