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 default ENTRYPOINT of 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. default 0
  • --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. default 0
  • --limit-pids=0 β€” limit maximum number of processes (default 0 = 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 (-1 for unlimited). default 0
  • --memory-swappiness=-1 β€” tune memory swappiness (0-100), -1 to 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-specified HEALTHCHECK
  • --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 (-1000 to 1000). default 0
  • --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 (default 0 = unlimited)
  • --reserve-cpu= β€” reserve CPUs
  • --reserve-memory=0 β€” reserve Memory. default 0
  • --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) (default 5s)
  • --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) (default 0s)
  • --rollback-failure-action="" β€” action on rollback failure ("pause", "continue") (default "pause")
  • --rollback-max-failure-ratio=0 β€” failure rate to tolerate during a rollback (default 0)
  • --rollback-monitor=0s β€” duration after each task rollback to monitor for failure (ns|us|ms|s|m|h) (default 5s)
  • --rollback-order="" β€” rollback order ("start-first", "stop-first") (default "stop-first")
  • --rollback-parallelism=1 β€” maximum number of tasks rolled back simultaneously (0 to roll back all at once). default 1
  • --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) (default 10s)
  • --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) (default 0s)
  • --update-failure-action="" β€” action on update failure ("pause", "continue", "rollback") (default "pause")
  • --update-max-failure-ratio=0 β€” failure rate to tolerate during an update (default 0)
  • --update-monitor=0s β€” duration after each task update to monitor for failure (ns|us|ms|s|m|h) (default 5s)
  • --update-order="" β€” update order ("start-first", "stop-first") (default "stop-first")
  • --update-parallelism=1 β€” maximum number of tasks updated simultaneously (0 to update all at once). default 1
  • -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