github.com/eikeon/docker@v1.5.0-rc4/docs/man/docker-create.1.md (about) 1 % DOCKER(1) Docker User Manuals 2 % Docker Community 3 % JUNE 2014 4 # NAME 5 docker-create - Create a new container 6 7 # SYNOPSIS 8 **docker create** 9 [**-a**|**--attach**[=*[]*]] 10 [**--add-host**[=*[]*]] 11 [**-c**|**--cpu-shares**[=*0*]] 12 [**--cap-add**[=*[]*]] 13 [**--cap-drop**[=*[]*]] 14 [**--cidfile**[=*CIDFILE*]] 15 [**--cpuset**[=*CPUSET*]] 16 [**--device**[=*[]*]] 17 [**--dns-search**[=*[]*]] 18 [**--dns**[=*[]*]] 19 [**-e**|**--env**[=*[]*]] 20 [**--entrypoint**[=*ENTRYPOINT*]] 21 [**--env-file**[=*[]*]] 22 [**--expose**[=*[]*]] 23 [**-h**|**--hostname**[=*HOSTNAME*]] 24 [**--help**] 25 [**-i**|**--interactive**[=*false*]] 26 [**--ipc**[=*IPC*]] 27 [**--link**[=*[]*]] 28 [**--lxc-conf**[=*[]*]] 29 [**-m**|**--memory**[=*MEMORY*]] 30 [**--mac-address**[=*MAC-ADDRESS*]] 31 [**--name**[=*NAME*]] 32 [**--net**[=*"bridge"*]] 33 [**-P**|**--publish-all**[=*false*]] 34 [**-p**|**--publish**[=*[]*]] 35 [**--pid**[=*[]*]] 36 [**--privileged**[=*false*]] 37 [**--read-only**[=*false*]] 38 [**--restart**[=*RESTART*]] 39 [**--security-opt**[=*[]*]] 40 [**-t**|**--tty**[=*false*]] 41 [**-u**|**--user**[=*USER*]] 42 [**-v**|**--volume**[=*[]*]] 43 [**--volumes-from**[=*[]*]] 44 [**-w**|**--workdir**[=*WORKDIR*]] 45 IMAGE [COMMAND] [ARG...] 46 47 # OPTIONS 48 **-a**, **--attach**=[] 49 Attach to STDIN, STDOUT or STDERR. 50 51 **--add-host**=[] 52 Add a custom host-to-IP mapping (host:ip) 53 54 **-c**, **--cpu-shares**=0 55 CPU shares (relative weight) 56 57 **--cap-add**=[] 58 Add Linux capabilities 59 60 **--cap-drop**=[] 61 Drop Linux capabilities 62 63 **--cidfile**="" 64 Write the container ID to the file 65 66 **--cpuset**="" 67 CPUs in which to allow execution (0-3, 0,1) 68 69 **--device**=[] 70 Add a host device to the container (e.g. --device=/dev/sdc:/dev/xvdc:rwm) 71 72 **--dns-search**=[] 73 Set custom DNS search domains (Use --dns-search=. if you don't wish to set the search domain) 74 75 **--dns**=[] 76 Set custom DNS servers 77 78 **-e**, **--env**=[] 79 Set environment variables 80 81 **--entrypoint**="" 82 Overwrite the default ENTRYPOINT of the image 83 84 **--env-file**=[] 85 Read in a line delimited file of environment variables 86 87 **--expose**=[] 88 Expose a port or a range of ports (e.g. --expose=3300-3310) from the container without publishing it to your host 89 90 **-h**, **--hostname**="" 91 Container host name 92 93 **--help** 94 Print usage statement 95 96 **-i**, **--interactive**=*true*|*false* 97 Keep STDIN open even if not attached. The default is *false*. 98 99 **--ipc**="" 100 Default is to create a private IPC namespace (POSIX SysV IPC) for the container 101 'container:<name|id>': reuses another container shared memory, semaphores and message queues 102 'host': use the host shared memory,semaphores and message queues inside the container. Note: the host mode gives the container full access to local shared memory and is therefore considered insecure. 103 104 **--link**=[] 105 Add link to another container in the form of <name or id>:alias 106 107 **--lxc-conf**=[] 108 (lxc exec-driver only) Add custom lxc options --lxc-conf="lxc.cgroup.cpuset.cpus = 0,1" 109 110 **-m**, **--memory**="" 111 Memory limit (format: <number><optional unit>, where unit = b, k, m or g) 112 113 **--mac-address**="" 114 Container MAC address (e.g. 92:d0:c6:0a:29:33) 115 116 **--name**="" 117 Assign a name to the container 118 119 **--net**="bridge" 120 Set the Network mode for the container 121 'bridge': creates a new network stack for the container on the docker bridge 122 'none': no networking for this container 123 'container:<name|id>': reuses another container network stack 124 'host': use the host network stack inside the container. Note: the host mode gives the container full access to local system services such as D-bus and is therefore considered insecure. 125 126 **-P**, **--publish-all**=*true*|*false* 127 Publish all exposed ports to random ports on the host interfaces. The default is *false*. 128 129 **-p**, **--publish**=[] 130 Publish a container's port, or a range of ports, to the host 131 format: ip:hostPort:containerPort | ip::containerPort | hostPort:containerPort | containerPort 132 Both hostPort and containerPort can be specified as a range of ports. 133 When specifying ranges for both, the number of container ports in the range must match the number of host ports in the range. (e.g., `-p 1234-1236:1234-1236/tcp`) 134 (use 'docker port' to see the actual mapping) 135 136 **--pid**=host 137 Set the PID mode for the container 138 **host**: use the host's PID namespace inside the container. 139 Note: the host mode gives the container full access to local PID and is therefore considered insecure. 140 141 **--privileged**=*true*|*false* 142 Give extended privileges to this container. The default is *false*. 143 144 **--read-only**=*true*|*false* 145 Mount the container's root filesystem as read only. 146 147 **--restart**="" 148 Restart policy to apply when a container exits (no, on-failure[:max-retry], always) 149 150 **--security-opt**=[] 151 Security Options 152 153 **-t**, **--tty**=*true*|*false* 154 Allocate a pseudo-TTY. The default is *false*. 155 156 **-u**, **--user**="" 157 Username or UID 158 159 **-v**, **--volume**=[] 160 Bind mount a volume (e.g., from the host: -v /host:/container, from Docker: -v /container) 161 162 **--volumes-from**=[] 163 Mount volumes from the specified container(s) 164 165 **-w**, **--workdir**="" 166 Working directory inside the container 167 168 # HISTORY 169 August 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 170 September 2014, updated by Sven Dowideit <SvenDowideit@home.org.au> 171 November 2014, updated by Sven Dowideit <SvenDowideit@home.org.au>