ubuntulinux.rst 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. :title: Requirements and Installation on Ubuntu Linux
  2. :description: Please note this project is currently under heavy development. It should not be used in production.
  3. :keywords: Docker, Docker documentation, requirements, virtualbox, vagrant, git, ssh, putty, cygwin, linux
  4. .. _ubuntu_linux:
  5. Ubuntu
  6. ======
  7. .. warning::
  8. These instructions have changed for 0.6. If you are upgrading from
  9. an earlier version, you will need to follow them again.
  10. .. include:: install_header.inc
  11. Docker is supported on the following versions of Ubuntu:
  12. - :ref:`ubuntu_precise`
  13. - :ref:`ubuntu_raring`
  14. Please read :ref:`ufw`, if you plan to use `UFW (Uncomplicated
  15. Firewall) <https://help.ubuntu.com/community/UFW>`_
  16. .. _ubuntu_precise:
  17. Ubuntu Precise 12.04 (LTS) (64-bit)
  18. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  19. This installation path should work at all times.
  20. Dependencies
  21. ------------
  22. **Linux kernel 3.8**
  23. Due to a bug in LXC, docker works best on the 3.8 kernel. Precise
  24. comes with a 3.2 kernel, so we need to upgrade it. The kernel you'll
  25. install when following these steps comes with AUFS built in. We also
  26. include the generic headers to enable packages that depend on them,
  27. like ZFS and the VirtualBox guest additions. If you didn't install the
  28. headers for your "precise" kernel, then you can skip these headers for
  29. the "raring" kernel. But it is safer to include them if you're not
  30. sure.
  31. .. code-block:: bash
  32. # install the backported kernel
  33. sudo apt-get update
  34. sudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring
  35. # reboot
  36. sudo reboot
  37. Installation
  38. ------------
  39. .. warning::
  40. These instructions have changed for 0.6. If you are upgrading from
  41. an earlier version, you will need to follow them again.
  42. Docker is available as a Debian package, which makes installation easy.
  43. First add the Docker repository key to your local keychain. You can use the
  44. ``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96
  45. 6E92 D857 6A8B A88D 21E9``
  46. .. code-block:: bash
  47. sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
  48. Add the Docker repository to your apt sources list, update and install the
  49. ``lxc-docker`` package.
  50. *You may receive a warning that the package isn't trusted. Answer yes to
  51. continue installation.*
  52. .. code-block:: bash
  53. sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\
  54. > /etc/apt/sources.list.d/docker.list"
  55. sudo apt-get update
  56. sudo apt-get install lxc-docker
  57. Now verify that the installation has worked by downloading the ``ubuntu`` image
  58. and launching a container.
  59. .. code-block:: bash
  60. sudo docker run -i -t ubuntu /bin/bash
  61. Type ``exit`` to exit
  62. **Done!**, now continue with the :ref:`hello_world` example.
  63. .. _ubuntu_raring:
  64. Ubuntu Raring 13.04 (64 bit)
  65. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  66. Dependencies
  67. ------------
  68. **Optional AUFS filesystem support**
  69. Ubuntu Raring already comes with the 3.8 kernel, so we don't need to install it. However, not all systems
  70. have AUFS filesystem support enabled. AUFS support is optional as of version 0.7, but it's still available as
  71. a driver and we recommend using it if you can.
  72. To make sure AUFS is installed, run the following commands:
  73. .. code-block:: bash
  74. sudo apt-get update
  75. sudo apt-get install linux-image-extra-`uname -r`
  76. Installation
  77. ------------
  78. Docker is available as a Debian package, which makes installation easy.
  79. .. warning::
  80. Please note that these instructions have changed for 0.6. If you are upgrading from an earlier version, you will need
  81. to follow them again.
  82. First add the Docker repository key to your local keychain. You can use the
  83. ``apt-key`` command to check the fingerprint matches: ``36A1 D786 9245 C895 0F96
  84. 6E92 D857 6A8B A88D 21E9``
  85. .. code-block:: bash
  86. sudo sh -c "wget -qO- https://get.docker.io/gpg | apt-key add -"
  87. Add the Docker repository to your apt sources list, update and install the
  88. ``lxc-docker`` package.
  89. .. code-block:: bash
  90. sudo sh -c "echo deb http://get.docker.io/ubuntu docker main\
  91. > /etc/apt/sources.list.d/docker.list"
  92. sudo apt-get update
  93. sudo apt-get install lxc-docker
  94. Now verify that the installation has worked by downloading the ``ubuntu`` image
  95. and launching a container.
  96. .. code-block:: bash
  97. sudo docker run -i -t ubuntu /bin/bash
  98. Type ``exit`` to exit
  99. **Done!**, now continue with the :ref:`hello_world` example.
  100. .. _ufw:
  101. Docker and UFW
  102. ^^^^^^^^^^^^^^
  103. Docker uses a bridge to manage container networking. By default, UFW drops all
  104. `forwarding` traffic. As a result will you need to enable UFW forwarding:
  105. .. code-block:: bash
  106. sudo nano /etc/default/ufw
  107. ----
  108. # Change:
  109. # DEFAULT_FORWARD_POLICY="DROP"
  110. # to
  111. DEFAULT_FORWARD_POLICY="ACCEPT"
  112. Then reload UFW:
  113. .. code-block:: bash
  114. sudo ufw reload
  115. UFW's default set of rules denies all `incoming` traffic. If you want to be
  116. able to reach your containers from another host then you should allow
  117. incoming connections on the Docker port (default 4243):
  118. .. code-block:: bash
  119. sudo ufw allow 4243/tcp