CmdID / docker / docker container
docker container run
Create and run a new container from an image Docker CLI reference
103 options
Also docker run
Its page in the Docker CLI reference
Options
Show its 103 options
--add-hostAdd a custom host-to-IP mapping (host:ip)--annotationAdd an annotation to the container (passed through to the OCI runtime)--attach, -aAttach to STDIN, STDOUT or STDERR--blkio-weight-deviceBlock IO weight (relative device weight)--blkio-weightBlock IO (relative weight), between 10 and 1000, or 0 to disable (default 0)--cap-addAdd Linux capabilities--cap-dropDrop Linux capabilities--cgroup-parentOptional parent cgroup for the container--cgroupnsCgroup namespace to use (host\--cidfileWrite the container ID to the file--cpu-countCPU count (Windows only)--cpu-percentCPU percent (Windows only)--cpu-periodLimit CPU CFS (Completely Fair Scheduler) period--cpu-quotaLimit CPU CFS (Completely Fair Scheduler) quota--cpu-rt-periodLimit CPU real-time period in microseconds--cpu-rt-runtimeLimit CPU real-time runtime in microseconds--cpu-shares, -cCPU shares (relative weight)--cpusNumber of CPUs--cpuset-cpusCPUs in which to allow execution (0-3, 0,1)--cpuset-memsMEMs in which to allow execution (0-3, 0,1)--detach, -dRun container in background and print container ID--detach-keysOverride the key sequence for detaching a container--device-cgroup-ruleAdd a rule to the cgroup allowed devices list--device-read-bpsLimit read rate (bytes per second) from a device--device-read-iopsLimit read rate (IO per second) from a device--device-write-bpsLimit write rate (bytes per second) to a device--device-write-iopsLimit write rate (IO per second) to a device--deviceAdd a host device to the container--dns-optionSet DNS options--dns-searchSet custom DNS search domains--dnsSet custom DNS servers--domainnameContainer NIS domain name--entrypointOverwrite the default ENTRYPOINT of the image--env, -eSet environment variables--env-fileRead in a file of environment variables--exposeExpose a port or a range of ports--gpusGPU devices to add to the container ('all' to pass all GPUs)--group-addAdd additional groups to join--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 starting health-retries countdown (ms\--health-timeoutMaximum time to allow one check to run (ms\--helpPrint usage--hostname, -hContainer host name--initRun an init inside the container that forwards signals and reaps processes--interactive, -iKeep STDIN open even if not attached--io-maxbandwidthMaximum IO bandwidth limit for the system drive (Windows only)--io-maxiopsMaximum IOps limit for the system drive (Windows only)--ip6IPv6 address (e.g., 2001:db8::33)--ipIPv4 address (e.g., 172.30.100.104)--ipcIPC mode to use--isolationContainer isolation technology--label, -lSet meta data on a container--label-fileRead in a line delimited file of labels--link-local-ipContainer IPv4/IPv6 link-local addresses--linkAdd link to another container--log-driverLogging driver for the container--log-optLog driver options--mac-addressContainer MAC address (e.g., 92:d0:c6:0a:29:33)--memory, -mMemory limit--memory-reservationMemory soft limit--memory-swapSwap limit equal to memory plus swap: '-1' to enable unlimited swap--memory-swappinessTune container memory swappiness (0 to 100)--mountAttach a filesystem mount to the container--nameAssign a name to the container--network-aliasAdd network-scoped alias for the container--networkConnect a container to a network--no-healthcheckDisable any container-specified HEALTHCHECK--oom-kill-disableDisable OOM Killer--oom-score-adjTune host's OOM preferences (-1000 to 1000)--pidPID namespace to use--pids-limitTune container pids limit (set -1 for unlimited)--platformSet platform if server is multi-platform capable--privilegedGive extended privileges to this container--publish, -pPublish a container's port(s) to the host--publish-all, -PPublish all exposed ports to random ports--pullPull image before running (always, missing, never)--quiet, -qSuppress the pull output--read-onlyMount the container's root filesystem as read only--restartRestart policy to apply when a container exits--rmAutomatically remove the container and its associated anonymous volumes when it exits--runtimeRuntime to use for this container--security-optSecurity Options--shm-sizeSize of /dev/shm--sig-proxyProxy received signals to the process--stop-signalSignal to stop the container--stop-timeoutTimeout (in seconds) to stop a container--storage-optStorage driver options for the container--sysctlSysctl options--tmpfsMount a tmpfs directory--tty, -tAllocate a pseudo-TTY--ulimitUlimit options--umaskSet umask for the container--use-api-socketBind mount Docker API socket and required auth--user, -uUsername or UID (format: <name\--usernsUser namespace to use--utsUTS namespace to use--volume, -vBind mount a volume--volume-driverOptional volume driver for the container--volumes-fromMount volumes from the specified container(s)--workdir, -wWorking directory inside the container