github.com/akashshinde/docker@v1.9.1/docs/misc/faq.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "FAQ"
     4  description = "Most frequently asked questions."
     5  keywords = ["faq, questions, documentation,  docker"]
     6  [menu.main]
     7  parent = "mn_about"
     8  weight = 3
     9  +++
    10  <![end-metadata]-->
    11  
    12  # Frequently Asked Questions (FAQ)
    13  
    14  If you don't see your question here, feel free to submit new ones to
    15  <docs@docker.com>.  Or, you can fork [the
    16  repo](https://github.com/docker/docker) and contribute them yourself by editing
    17  the documentation sources.
    18  
    19  
    20  ### How much does Docker cost?
    21  
    22  Docker is 100% free. It is open source, so you can use it without paying.
    23  
    24  ### What open source license are you using?
    25  
    26  We are using the Apache License Version 2.0, see it here:
    27  [https://github.com/docker/docker/blob/master/LICENSE](
    28  https://github.com/docker/docker/blob/master/LICENSE)
    29  
    30  ### Does Docker run on Mac OS X or Windows?
    31  
    32  Docker currently runs only on Linux, but you can use VirtualBox to run Docker in
    33  a virtual machine on your box, and get the best of both worlds. Check out the
    34  [*Mac OS X*](../installation/mac.md) and [*Microsoft
    35  Windows*](../installation/windows.md) installation guides. The small Linux
    36  distribution Docker Machine can be run inside virtual machines on these two
    37  operating systems.
    38  
    39  >**Note:** if you are using a remote Docker daemon on a VM through Docker
    40  >Machine, then _do not_ type the `sudo` before the `docker` commands shown in
    41  >the documentation's examples.
    42  
    43  ### How do containers compare to virtual machines?
    44  
    45  They are complementary. VMs are best used to allocate chunks of hardware
    46  resources. Containers operate at the process level, which makes them very
    47  lightweight and perfect as a unit of software delivery.
    48  
    49  ### What does Docker add to just plain LXC?
    50  
    51  Docker is not a replacement for LXC. "LXC" refers to capabilities of the Linux
    52  kernel (specifically namespaces and control groups) which allow sandboxing
    53  processes from one another, and controlling their resource allocations. On top
    54  of this low-level foundation of kernel features, Docker offers a high-level tool
    55  with several powerful functionalities:
    56  
    57   - *Portable deployment across machines.* Docker defines a format for bundling
    58   an application and all its dependencies into a single object which can be
    59   transferred to any Docker-enabled machine, and executed there with the
    60   guarantee that the execution environment exposed to the application will be the
    61   same. LXC implements process sandboxing, which is an important pre-requisite
    62   for portable deployment, but that alone is not enough for portable deployment.
    63   If you sent me a copy of your application installed in a custom LXC
    64   configuration, it would almost certainly not run on my machine the way it does
    65   on yours, because it is tied to your machine's specific configuration:
    66   networking, storage, logging, distro, etc. Docker defines an abstraction for
    67   these machine-specific settings, so that the exact same Docker container can
    68   run - unchanged - on many different machines, with many different
    69   configurations.
    70  
    71   - *Application-centric.* Docker is optimized for the deployment of
    72   applications, as opposed to machines. This is reflected in its API, user
    73   interface, design philosophy and documentation. By contrast, the `lxc` helper
    74   scripts focus on containers as lightweight machines - basically servers that
    75   boot faster and need less RAM. We think there's more to containers than just
    76   that.
    77  
    78   - *Automatic build.* Docker includes [*a tool for developers to automatically
    79   assemble a container from their source
    80   code*](../reference/builder.md), with full control over application
    81   dependencies, build tools, packaging etc. They are free to use `make`, `maven`,
    82   `chef`, `puppet`, `salt,` Debian packages, RPMs, source tarballs, or any
    83   combination of the above, regardless of the configuration of the machines.
    84  
    85   - *Versioning.* Docker includes git-like capabilities for tracking successive
    86   versions of a container, inspecting the diff between versions, committing new
    87   versions, rolling back etc. The history also includes how a container was
    88   assembled and by whom, so you get full traceability from the production server
    89   all the way back to the upstream developer. Docker also implements incremental
    90   uploads and downloads, similar to `git pull`, so new versions of a container
    91   can be transferred by only sending diffs.
    92  
    93   - *Component re-use.* Any container can be used as a [*"base image"*](../reference/glossary.md#image) to create more specialized components. This can
    94   be done manually or as part of an automated build. For example you can prepare
    95   the ideal Python environment, and use it as a base for 10 different
    96   applications. Your ideal PostgreSQL setup can be re-used for all your future
    97   projects. And so on.
    98  
    99   - *Sharing.* Docker has access to a public registry [on Docker Hub](https://hub.docker.com/)
   100   where thousands of people have uploaded useful images: anything from Redis,
   101   CouchDB, PostgreSQL to IRC bouncers to Rails app servers to Hadoop to base
   102   images for various Linux distros. The
   103   [*registry*](https://docs.docker.com/registry/) also
   104   includes an official "standard library" of useful containers maintained by the
   105   Docker team. The registry itself is open-source, so anyone can deploy their own
   106   registry to store and transfer private containers, for internal server
   107   deployments for example.
   108  
   109   - *Tool ecosystem.* Docker defines an API for automating and customizing the
   110   creation and deployment of containers. There are a huge number of tools
   111   integrating with Docker to extend its capabilities. PaaS-like deployment
   112   (Dokku, Deis, Flynn), multi-node orchestration (Maestro, Salt, Mesos, Openstack
   113   Nova), management dashboards (docker-ui, Openstack Horizon, Shipyard),
   114   configuration management (Chef, Puppet), continuous integration (Jenkins,
   115   Strider, Travis), etc. Docker is rapidly establishing itself as the standard
   116   for container-based tooling.
   117  
   118  ### What is different between a Docker container and a VM?
   119  
   120  There's a great StackOverflow answer [showing the differences](
   121  http://stackoverflow.com/questions/16047306/how-is-docker-io-different-from-a-normal-virtual-machine).
   122  
   123  ### Do I lose my data when the container exits?
   124  
   125  Not at all! Any data that your application writes to disk gets preserved in its
   126  container until you explicitly delete the container. The file system for the
   127  container persists even after the container halts.
   128  
   129  ### How far do Docker containers scale?
   130  
   131  Some of the largest server farms in the world today are based on containers.
   132  Large web deployments like Google and Twitter, and platform providers such as
   133  Heroku and dotCloud all run on container technology, at a scale of hundreds of
   134  thousands or even millions of containers running in parallel.
   135  
   136  ### How do I connect Docker containers?
   137  
   138  Currently the recommended way to connect containers is via the Docker network feature. You can see details of how to [work with Docker networks here](https://docs.docker.com/networking).
   139  
   140  Also useful for more flexible service portability is the [Ambassador linking
   141  pattern](../articles/ambassador_pattern_linking.md).
   142  
   143  ### How do I run more than one process in a Docker container?
   144  
   145  Any capable process supervisor such as [http://supervisord.org/](
   146  http://supervisord.org/), runit, s6, or daemontools can do the trick. Docker
   147  will start up the process management daemon which will then fork to run
   148  additional processes. As long as the processor manager daemon continues to run,
   149  the container will continue to as well. You can see a more substantial example
   150  [that uses supervisord here](../articles/using_supervisord.md).
   151  
   152  ### What platforms does Docker run on?
   153  
   154  Linux:
   155  
   156   - Ubuntu 12.04, 13.04 et al
   157   - Fedora 19/20+
   158   - RHEL 6.5+
   159   - CentOS 6+
   160   - Gentoo
   161   - ArchLinux
   162   - openSUSE 12.3+
   163   - CRUX 3.0+
   164  
   165  Cloud:
   166  
   167   - Amazon EC2
   168   - Google Compute Engine
   169   - Microsoft Azure
   170   - Rackspace
   171  
   172  ### How do I report a security issue with Docker?
   173  
   174  You can learn about the project's security policy
   175  [here](https://www.docker.com/security/) and report security issues to this
   176  [mailbox](mailto:security@docker.com).
   177  
   178  ### Why do I need to sign my commits to Docker with the DCO?
   179  
   180  Please read [our blog post](
   181  http://blog.docker.com/2014/01/docker-code-contributions-require-developer-certificate-of-origin/) on the introduction of the DCO.
   182  
   183  ### When building an image, should I prefer system libraries or bundled ones?
   184  
   185  *This is a summary of a discussion on the [docker-dev mailing list](
   186  https://groups.google.com/forum/#!topic/docker-dev/L2RBSPDu1L0).*
   187  
   188  Virtually all programs depend on third-party libraries. Most frequently, they
   189  will use dynamic linking and some kind of package dependency, so that when
   190  multiple programs need the same library, it is installed only once.
   191  
   192  Some programs, however, will bundle their third-party libraries, because they
   193  rely on very specific versions of those libraries. For instance, Node.js bundles
   194  OpenSSL; MongoDB bundles V8 and Boost (among others).
   195  
   196  When creating a Docker image, is it better to use the bundled libraries, or
   197  should you build those programs so that they use the default system libraries
   198  instead?
   199  
   200  The key point about system libraries is not about saving disk or memory space.
   201  It is about security. All major distributions handle security seriously, by
   202  having dedicated security teams, following up closely with published
   203  vulnerabilities, and disclosing advisories themselves. (Look at the [Debian
   204  Security Information](https://www.debian.org/security/) for an example of those
   205  procedures.) Upstream developers, however, do not always implement similar
   206  practices.
   207  
   208  Before setting up a Docker image to compile a program from source, if you want
   209  to use bundled libraries, you should check if the upstream authors provide a
   210  convenient way to announce security vulnerabilities, and if they update their
   211  bundled libraries in a timely manner. If they don't, you are exposing yourself
   212  (and the users of your image) to security vulnerabilities.
   213  
   214  Likewise, before using packages built by others, you should check if the
   215  channels providing those packages implement similar security best practices.
   216  Downloading and installing an "all-in-one" .deb or .rpm sounds great at first,
   217  except if you have no way to figure out that it contains a copy of the OpenSSL
   218  library vulnerable to the [Heartbleed](http://heartbleed.com/) bug.
   219  
   220  ### Why is `DEBIAN_FRONTEND=noninteractive` discouraged in Dockerfiles?
   221  
   222  When building Docker images on Debian and Ubuntu you may have seen errors like:
   223  
   224      unable to initialize frontend: Dialog
   225  
   226  These errors don't stop the image from being built but inform you that the
   227  installation process tried to open a dialog box, but was unable to. Generally,
   228  these errors are safe to ignore.
   229  
   230  Some people circumvent these errors by changing the `DEBIAN_FRONTEND`
   231  environment variable inside the Dockerfile using:
   232  
   233      ENV DEBIAN_FRONTEND=noninteractive
   234  
   235  This prevents the installer from opening dialog boxes during installation which
   236  stops the errors.
   237  
   238  While this may sound like a good idea, it *may* have side effects. The
   239  `DEBIAN_FRONTEND` environment variable will be inherited by all images and
   240  containers built from your image, effectively changing their behavior. People
   241  using those images will run into problems when installing software
   242  interactively, because installers will not show any dialog boxes.
   243  
   244  Because of this, and because setting `DEBIAN_FRONTEND` to `noninteractive` is
   245  mainly a 'cosmetic' change, we *discourage* changing it.
   246  
   247  If you *really* need to change its setting, make sure to change it back to its
   248  [default value](https://www.debian.org/releases/stable/i386/ch05s03.html.en)
   249  afterwards.
   250  
   251  ### Why do I get `Connection reset by peer` when making a request to a service running in a container?
   252  
   253  Typically, this message is returned if the service is already bound to your
   254  localhost. As a result, requests coming to the container from outside are
   255  dropped. To correct this problem, change the service's configuration on your
   256  localhost so that the service accepts requests from all IPs.  If you aren't sure
   257  how to do this, check the documentation for your OS.
   258  
   259  
   260  ### Where can I find more answers?
   261  
   262  You can find more answers on:
   263  
   264  
   265  - [Docker user mailinglist](https://groups.google.com/d/forum/docker-user)
   266  - [Docker developer mailinglist](https://groups.google.com/d/forum/docker-dev)
   267  - [IRC, docker on freenode](irc://chat.freenode.net#docker)
   268  - [GitHub](https://github.com/docker/docker)
   269  - [Ask questions on Stackoverflow](http://stackoverflow.com/search?q=docker)
   270  - [Join the conversation on Twitter](http://twitter.com/docker)
   271  
   272  Looking for something else to read? Checkout the [User Guide](../userguide/).