github.com/panekj/cli@v0.0.0-20230304125325-467dd2f3797e/docs/reference/commandline/container_create.md (about) 1 # container create 2 3 <!---MARKER_GEN_START--> 4 Create a new container 5 6 ### Aliases 7 8 `docker container create`, `docker create` 9 10 ### Options 11 12 | Name | Type | Default | Description | 13 |:--------------------------|:--------------|:----------|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| 14 | `--add-host` | `list` | | Add a custom host-to-IP mapping (host:ip) | 15 | `-a`, `--attach` | `list` | | Attach to STDIN, STDOUT or STDERR | 16 | `--blkio-weight` | `uint16` | `0` | Block IO (relative weight), between 10 and 1000, or 0 to disable (default 0) | 17 | `--blkio-weight-device` | `list` | | Block IO weight (relative device weight) | 18 | `--cap-add` | `list` | | Add Linux capabilities | 19 | `--cap-drop` | `list` | | Drop Linux capabilities | 20 | `--cgroup-parent` | `string` | | Optional parent cgroup for the container | 21 | `--cgroupns` | `string` | | Cgroup namespace to use (host\|private)<br>'host': Run the container in the Docker host's cgroup namespace<br>'private': Run the container in its own private cgroup namespace<br>'': Use the cgroup namespace as configured by the<br> default-cgroupns-mode option on the daemon (default) | 22 | `--cidfile` | `string` | | Write the container ID to the file | 23 | `--cpu-count` | `int64` | `0` | CPU count (Windows only) | 24 | `--cpu-percent` | `int64` | `0` | CPU percent (Windows only) | 25 | `--cpu-period` | `int64` | `0` | Limit CPU CFS (Completely Fair Scheduler) period | 26 | `--cpu-quota` | `int64` | `0` | Limit CPU CFS (Completely Fair Scheduler) quota | 27 | `--cpu-rt-period` | `int64` | `0` | Limit CPU real-time period in microseconds | 28 | `--cpu-rt-runtime` | `int64` | `0` | Limit CPU real-time runtime in microseconds | 29 | `-c`, `--cpu-shares` | `int64` | `0` | CPU shares (relative weight) | 30 | `--cpus` | `decimal` | | Number of CPUs | 31 | `--cpuset-cpus` | `string` | | CPUs in which to allow execution (0-3, 0,1) | 32 | `--cpuset-mems` | `string` | | MEMs in which to allow execution (0-3, 0,1) | 33 | `--device` | `list` | | Add a host device to the container | 34 | `--device-cgroup-rule` | `list` | | Add a rule to the cgroup allowed devices list | 35 | `--device-read-bps` | `list` | | Limit read rate (bytes per second) from a device | 36 | `--device-read-iops` | `list` | | Limit read rate (IO per second) from a device | 37 | `--device-write-bps` | `list` | | Limit write rate (bytes per second) to a device | 38 | `--device-write-iops` | `list` | | Limit write rate (IO per second) to a device | 39 | `--disable-content-trust` | | | Skip image verification | 40 | `--dns` | `list` | | Set custom DNS servers | 41 | `--dns-option` | `list` | | Set DNS options | 42 | `--dns-search` | `list` | | Set custom DNS search domains | 43 | `--domainname` | `string` | | Container NIS domain name | 44 | `--entrypoint` | `string` | | Overwrite the default ENTRYPOINT of the image | 45 | `-e`, `--env` | `list` | | Set environment variables | 46 | `--env-file` | `list` | | Read in a file of environment variables | 47 | `--expose` | `list` | | Expose a port or a range of ports | 48 | `--gpus` | `gpu-request` | | GPU devices to add to the container ('all' to pass all GPUs) | 49 | `--group-add` | `list` | | Add additional groups to join | 50 | `--health-cmd` | `string` | | Command to run to check health | 51 | `--health-interval` | `duration` | `0s` | Time between running the check (ms\|s\|m\|h) (default 0s) | 52 | `--health-retries` | `int` | `0` | Consecutive failures needed to report unhealthy | 53 | `--health-start-period` | `duration` | `0s` | Start period for the container to initialize before starting health-retries countdown (ms\|s\|m\|h) (default 0s) | 54 | `--health-timeout` | `duration` | `0s` | Maximum time to allow one check to run (ms\|s\|m\|h) (default 0s) | 55 | `--help` | | | Print usage | 56 | `-h`, `--hostname` | `string` | | Container host name | 57 | `--init` | | | Run an init inside the container that forwards signals and reaps processes | 58 | `-i`, `--interactive` | | | Keep STDIN open even if not attached | 59 | `--io-maxbandwidth` | `bytes` | `0` | Maximum IO bandwidth limit for the system drive (Windows only) | 60 | `--io-maxiops` | `uint64` | `0` | Maximum IOps limit for the system drive (Windows only) | 61 | `--ip` | `string` | | IPv4 address (e.g., 172.30.100.104) | 62 | `--ip6` | `string` | | IPv6 address (e.g., 2001:db8::33) | 63 | `--ipc` | `string` | | IPC mode to use | 64 | `--isolation` | `string` | | Container isolation technology | 65 | `--kernel-memory` | `bytes` | `0` | Kernel memory limit | 66 | `-l`, `--label` | `list` | | Set meta data on a container | 67 | `--label-file` | `list` | | Read in a line delimited file of labels | 68 | `--link` | `list` | | Add link to another container | 69 | `--link-local-ip` | `list` | | Container IPv4/IPv6 link-local addresses | 70 | `--log-driver` | `string` | | Logging driver for the container | 71 | `--log-opt` | `list` | | Log driver options | 72 | `--mac-address` | `string` | | Container MAC address (e.g., 92:d0:c6:0a:29:33) | 73 | `-m`, `--memory` | `bytes` | `0` | Memory limit | 74 | `--memory-reservation` | `bytes` | `0` | Memory soft limit | 75 | `--memory-swap` | `bytes` | `0` | Swap limit equal to memory plus swap: '-1' to enable unlimited swap | 76 | `--memory-swappiness` | `int64` | `-1` | Tune container memory swappiness (0 to 100) | 77 | `--mount` | `mount` | | Attach a filesystem mount to the container | 78 | `--name` | `string` | | Assign a name to the container | 79 | `--network` | `network` | | Connect a container to a network | 80 | `--network-alias` | `list` | | Add network-scoped alias for the container | 81 | `--no-healthcheck` | | | Disable any container-specified HEALTHCHECK | 82 | `--oom-kill-disable` | | | Disable OOM Killer | 83 | `--oom-score-adj` | `int` | `0` | Tune host's OOM preferences (-1000 to 1000) | 84 | `--pid` | `string` | | PID namespace to use | 85 | `--pids-limit` | `int64` | `0` | Tune container pids limit (set -1 for unlimited) | 86 | `--platform` | `string` | | Set platform if server is multi-platform capable | 87 | `--privileged` | | | Give extended privileges to this container | 88 | `-p`, `--publish` | `list` | | Publish a container's port(s) to the host | 89 | `-P`, `--publish-all` | | | Publish all exposed ports to random ports | 90 | `--pull` | `string` | `missing` | Pull image before creating (`always`, `\|missing`, `never`) | 91 | `-q`, `--quiet` | | | Suppress the pull output | 92 | `--read-only` | | | Mount the container's root filesystem as read only | 93 | `--restart` | `string` | `no` | Restart policy to apply when a container exits | 94 | `--rm` | | | Automatically remove the container when it exits | 95 | `--runtime` | `string` | | Runtime to use for this container | 96 | `--security-opt` | `list` | | Security Options | 97 | `--shm-size` | `bytes` | `0` | Size of /dev/shm | 98 | `--stop-signal` | `string` | | Signal to stop the container | 99 | `--stop-timeout` | `int` | `0` | Timeout (in seconds) to stop a container | 100 | `--storage-opt` | `list` | | Storage driver options for the container | 101 | `--sysctl` | `map` | `map[]` | Sysctl options | 102 | `--tmpfs` | `list` | | Mount a tmpfs directory | 103 | `-t`, `--tty` | | | Allocate a pseudo-TTY | 104 | `--ulimit` | `ulimit` | | Ulimit options | 105 | `-u`, `--user` | `string` | | Username or UID (format: <name\|uid>[:<group\|gid>]) | 106 | `--userns` | `string` | | User namespace to use | 107 | `--uts` | `string` | | UTS namespace to use | 108 | `-v`, `--volume` | `list` | | Bind mount a volume | 109 | `--volume-driver` | `string` | | Optional volume driver for the container | 110 | `--volumes-from` | `list` | | Mount volumes from the specified container(s) | 111 | `-w`, `--workdir` | `string` | | Working directory inside the container | 112 113 114 <!---MARKER_GEN_END--> 115 116 ## Description 117 118 See [docker create](create.md) for more information.