faq.rst 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. :title: FAQ
  2. :description: Most frequently asked questions.
  3. :keywords: faq, questions, documentation, docker
  4. FAQ
  5. ===
  6. Most frequently asked questions.
  7. --------------------------------
  8. How much does Docker cost?
  9. ..........................
  10. Docker is 100% free, it is open source, so you can use it without paying.
  11. What open source license are you using?
  12. .......................................
  13. We are using the Apache License Version 2.0, see it here:
  14. https://github.com/dotcloud/docker/blob/master/LICENSE
  15. Does Docker run on Mac OS X or Windows?
  16. .......................................
  17. Not at this time, Docker currently only runs on Linux, but you can
  18. use VirtualBox to run Docker in a virtual machine on your box, and
  19. get the best of both worlds. Check out the
  20. :ref:`install_using_vagrant` and :ref:`windows` installation
  21. guides.
  22. How do containers compare to virtual machines?
  23. ..............................................
  24. They are complementary. VMs are best used to allocate chunks of
  25. hardware resources. Containers operate at the process level, which
  26. makes them very lightweight and perfect as a unit of software
  27. delivery.
  28. What does Docker add to just plain LXC?
  29. .......................................
  30. Docker is not a replacement for LXC. "LXC" refers to capabilities
  31. of the Linux kernel (specifically namespaces and control groups)
  32. which allow sandboxing processes from one another, and controlling
  33. their resource allocations. On top of this low-level foundation of
  34. kernel features, Docker offers a high-level tool with several
  35. powerful functionalities:
  36. * *Portable deployment across machines.*
  37. Docker defines a format for bundling an application and all its
  38. dependencies into a single object which can be transferred to
  39. any Docker-enabled machine, and executed there with the
  40. guarantee that the execution environment exposed to the
  41. application will be the same. LXC implements process sandboxing,
  42. which is an important pre-requisite for portable deployment, but
  43. that alone is not enough for portable deployment. If you sent me
  44. a copy of your application installed in a custom LXC
  45. configuration, it would almost certainly not run on my machine
  46. the way it does on yours, because it is tied to your machine's
  47. specific configuration: networking, storage, logging, distro,
  48. etc. Docker defines an abstraction for these machine-specific
  49. settings, so that the exact same Docker container can run -
  50. unchanged - on many different machines, with many different
  51. configurations.
  52. * *Application-centric.*
  53. Docker is optimized for the deployment of applications, as
  54. opposed to machines. This is reflected in its API, user
  55. interface, design philosophy and documentation. By contrast, the
  56. ``lxc`` helper scripts focus on containers as lightweight
  57. machines - basically servers that boot faster and need less
  58. RAM. We think there's more to containers than just that.
  59. * *Automatic build.*
  60. Docker includes :ref:`a tool for developers to automatically
  61. assemble a container from their source code <dockerbuilder>`,
  62. with full control over application dependencies, build tools,
  63. packaging etc. They are free to use ``make, maven, chef, puppet,
  64. salt,`` Debian packages, RPMs, source tarballs, or any
  65. combination of the above, regardless of the configuration of the
  66. machines.
  67. * *Versioning.*
  68. Docker includes git-like capabilities for tracking successive
  69. versions of a container, inspecting the diff between versions,
  70. committing new versions, rolling back etc. The history also
  71. includes how a container was assembled and by whom, so you get
  72. full traceability from the production server all the way back to
  73. the upstream developer. Docker also implements incremental
  74. uploads and downloads, similar to ``git pull``, so new versions
  75. of a container can be transferred by only sending diffs.
  76. * *Component re-use.*
  77. Any container can be used as a :ref:`"base image"
  78. <base_image_def>` to create more specialized components. This
  79. can be done manually or as part of an automated build. For
  80. example you can prepare the ideal Python environment, and use it
  81. as a base for 10 different applications. Your ideal Postgresql
  82. setup can be re-used for all your future projects. And so on.
  83. * *Sharing.*
  84. Docker has access to a `public registry
  85. <http://index.docker.io>`_ where thousands of people have
  86. uploaded useful containers: anything from Redis, CouchDB,
  87. Postgres to IRC bouncers to Rails app servers to Hadoop to base
  88. images for various Linux distros. The :ref:`registry
  89. <registryindexspec>` also includes an official "standard
  90. library" of useful containers maintained by the Docker team. The
  91. registry itself is open-source, so anyone can deploy their own
  92. registry to store and transfer private containers, for internal
  93. server deployments for example.
  94. * *Tool ecosystem.*
  95. Docker defines an API for automating and customizing the
  96. creation and deployment of containers. There are a huge number
  97. of tools integrating with Docker to extend its
  98. capabilities. PaaS-like deployment (Dokku, Deis, Flynn),
  99. multi-node orchestration (Maestro, Salt, Mesos, Openstack Nova),
  100. management dashboards (docker-ui, Openstack Horizon, Shipyard),
  101. configuration management (Chef, Puppet), continuous integration
  102. (Jenkins, Strider, Travis), etc. Docker is rapidly establishing
  103. itself as the standard for container-based tooling.
  104. What is different between a Docker container and a VM?
  105. ......................................................
  106. There's a great StackOverflow answer `showing the differences <http://stackoverflow.com/questions/16047306/how-is-docker-io-different-from-a-normal-virtual-machine>`_.
  107. Do I lose my data when the container exits?
  108. ...........................................
  109. Not at all! Any data that your application writes to disk gets preserved
  110. in its container until you explicitly delete the container. The file
  111. system for the container persists even after the container halts.
  112. How far do Docker containers scale?
  113. ...................................
  114. Some of the largest server farms in the world today are based on containers.
  115. Large web deployments like Google and Twitter, and platform providers such as
  116. Heroku and dotCloud all run on container technology, at a scale of hundreds of
  117. thousands or even millions of containers running in parallel.
  118. How do I connect Docker containers?
  119. ...................................
  120. Currently the recommended way to link containers is via the `link` primitive.
  121. You can see details of how to `work with links here
  122. <http://docs.docker.io/en/latest/use/working_with_links_names/>`_.
  123. Also of useful when enabling more flexible service portability is the
  124. `Ambassador linking pattern
  125. <http://docs.docker.io/en/latest/use/ambassador_pattern_linking/>`_.
  126. How do I run more than one process in a Docker container?
  127. .........................................................
  128. Any capable process supervisor such as http://supervisord.org/, runit, s6, or
  129. daemontools can do the trick. Docker will start up the process management
  130. daemon which will then fork to run additional processes. As long as the
  131. processor manager daemon continues to run, the container will continue to as
  132. well. You can see a more substantial example `that uses supervisord here
  133. <http://docs.docker.io/en/latest/examples/using_supervisord/>`_.
  134. What platforms does Docker run on?
  135. ..................................
  136. Linux:
  137. - Ubuntu 12.04, 13.04 et al
  138. - Fedora 19/20+
  139. - RHEL 6.5+
  140. - Centos 6+
  141. - Gentoo
  142. - ArchLinux
  143. - openSUSE 12.3+
  144. Cloud:
  145. - Amazon EC2
  146. - Google Compute Engine
  147. - Rackspace
  148. Can I help by adding some questions and answers?
  149. ................................................
  150. Definitely! You can fork `the repo`_ and edit the documentation sources.
  151. Where can I find more answers?
  152. ..............................
  153. You can find more answers on:
  154. * `Docker user mailinglist`_
  155. * `Docker developer mailinglist`_
  156. * `IRC, docker on freenode`_
  157. * `GitHub`_
  158. * `Ask questions on Stackoverflow`_
  159. * `Join the conversation on Twitter`_
  160. .. _Docker user mailinglist: https://groups.google.com/d/forum/docker-user
  161. .. _Docker developer mailinglist: https://groups.google.com/d/forum/docker-dev
  162. .. _the repo: http://www.github.com/dotcloud/docker
  163. .. _IRC, docker on freenode: irc://chat.freenode.net#docker
  164. .. _Github: http://www.github.com/dotcloud/docker
  165. .. _Ask questions on Stackoverflow: http://stackoverflow.com/search?q=docker
  166. .. _Join the conversation on Twitter: http://twitter.com/docker
  167. Looking for something else to read? Checkout the :ref:`hello_world` example.