cli.rst 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. :title: Command Line Interface
  2. :description: Docker's CLI command description and usage
  3. :keywords: Docker, Docker documentation, CLI, command line
  4. Command Line Interface
  5. ======================
  6. Docker Usage
  7. ~~~~~~~~~~~~
  8. ::
  9. $ docker
  10. Usage: docker COMMAND [arg...]
  11. A self-sufficient runtime for linux containers.
  12. Commands:
  13. attach Attach to a running container
  14. commit Create a new image from a container's changes
  15. diff Inspect changes on a container's filesystem
  16. export Stream the contents of a container as a tar archive
  17. history Show the history of an image
  18. images List images
  19. import Create a new filesystem image from the contents of a tarball
  20. info Display system-wide information
  21. inspect Return low-level information on a container
  22. kill Kill a running container
  23. login Register or Login to the docker registry server
  24. logs Fetch the logs of a container
  25. port Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
  26. ps List containers
  27. pull Pull an image or a repository to the docker registry server
  28. push Push an image or a repository to the docker registry server
  29. restart Restart a running container
  30. rm Remove a container
  31. rmi Remove an image
  32. run Run a command in a new container
  33. start Start a stopped container
  34. stop Stop a running container
  35. tag Tag an image into a repository
  36. version Show the docker version information
  37. wait Block until a container stops, then print its exit code
  38. attach
  39. ~~~~~~
  40. ::
  41. Usage: docker attach [OPTIONS]
  42. Attach to a running container
  43. -e=true: Attach to stderr
  44. -i=false: Attach to stdin
  45. -o=true: Attach to stdout
  46. commit
  47. ~~~~~~
  48. ::
  49. Usage: docker commit [OPTIONS] CONTAINER [DEST]
  50. Create a new image from a container's changes
  51. -m="": Commit message
  52. diff
  53. ~~~~
  54. ::
  55. Usage: docker diff CONTAINER [OPTIONS]
  56. Inspect changes on a container's filesystem
  57. export
  58. ~~~~~~
  59. ::
  60. Usage: docker export CONTAINER
  61. Export the contents of a filesystem as a tar archive
  62. history
  63. ~~~~~~~
  64. ::
  65. Usage: docker history [OPTIONS] IMAGE
  66. Show the history of an image
  67. images
  68. ~~~~~~
  69. ::
  70. Usage: docker images [OPTIONS] [NAME]
  71. List images
  72. -a=false: show all images
  73. -q=false: only show numeric IDs
  74. import
  75. ~~~~~~
  76. ::
  77. Usage: docker import [OPTIONS] URL|- [REPOSITORY [TAG]]
  78. Create a new filesystem image from the contents of a tarball
  79. info
  80. ~~~~
  81. ::
  82. Usage: docker info
  83. Display system-wide information.
  84. inspect
  85. ~~~~~~~
  86. ::
  87. Usage: docker inspect [OPTIONS] CONTAINER
  88. Return low-level information on a container
  89. kill
  90. ~~~~
  91. ::
  92. Usage: docker kill [OPTIONS] CONTAINER [CONTAINER...]
  93. Kill a running container
  94. login
  95. ~~~~~
  96. ::
  97. Usage: docker login
  98. Register or Login to the docker registry server
  99. logs
  100. ~~~~
  101. ::
  102. Usage: docker logs [OPTIONS] CONTAINER
  103. Fetch the logs of a container
  104. port
  105. ~~~~
  106. ::
  107. Usage: docker port [OPTIONS] CONTAINER PRIVATE_PORT
  108. Lookup the public-facing port which is NAT-ed to PRIVATE_PORT
  109. ps
  110. ~~
  111. ::
  112. Usage: docker ps [OPTIONS]
  113. List containers
  114. -a=false: Show all containers. Only running containers are shown by default.
  115. -notrunc=false: Don't truncate output
  116. -q=false: Only display numeric IDs
  117. pull
  118. ~~~~
  119. ::
  120. Usage: docker pull NAME
  121. Pull an image or a repository from the registry
  122. push
  123. ~~~~
  124. ::
  125. Usage: docker push NAME
  126. Push an image or a repository to the registry
  127. restart
  128. ~~~~~~~
  129. ::
  130. Usage: docker restart [OPTIONS] NAME
  131. Restart a running container
  132. rm
  133. ~~
  134. ::
  135. Usage: docker rm [OPTIONS] CONTAINER
  136. Remove a container
  137. rmi
  138. ~~~
  139. ::
  140. Usage: docker rmi [OPTIONS] IMAGE
  141. Remove an image
  142. -a=false: Use IMAGE as a path and remove ALL images in this path
  143. -r=false: Use IMAGE as a regular expression instead of an exact name
  144. run
  145. ~~~
  146. ::
  147. Usage: docker run [OPTIONS] IMAGE COMMAND [ARG...]
  148. Run a command in a new container
  149. -c="": Comment
  150. -i=false: Keep stdin open even if not attached
  151. -m=0: Memory limit (in bytes)
  152. -p=[]: Map a network port to the container
  153. -t=false: Allocate a pseudo-tty
  154. -u="": Username or UID
  155. start
  156. ~~~~~
  157. ::
  158. Usage: docker start [OPTIONS] NAME
  159. Start a stopped container
  160. stop
  161. ~~~~
  162. ::
  163. Usage: docker stop [OPTIONS] NAME
  164. Stop a running container
  165. tag
  166. ~~~
  167. ::
  168. Usage: docker tag [OPTIONS] IMAGE REPOSITORY [TAG]
  169. Tag an image into a repository
  170. -f=false: Force
  171. version
  172. ~~~~~~~
  173. ::
  174. Usage: docker version
  175. Show the docker version information
  176. wait
  177. ~~~~
  178. ::
  179. Usage: docker wait [OPTIONS] NAME
  180. Block until a container stops, then print its exit code.