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