ubuntulinux.rst 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  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 Linux
  6. ============
  7. **Please note this project is currently under heavy development. It should not be used in production.**
  8. Right now, the officially supported distribution are:
  9. - :ref:`ubuntu_precise`
  10. - :ref:`ubuntu_raring`
  11. Docker has the following dependencies
  12. * Linux kernel 3.8 (read more about :ref:`kernel`)
  13. * AUFS file system support (we are working on BTRFS support as an alternative)
  14. Please read :ref:`ufw`, if you plan to use `UFW (Uncomplicated Firewall) <https://help.ubuntu.com/community/UFW>`_
  15. .. _ubuntu_precise:
  16. Ubuntu Precise 12.04 (LTS) (64-bit)
  17. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  18. This installation path should work at all times.
  19. Dependencies
  20. ------------
  21. **Linux kernel 3.8**
  22. Due to a bug in LXC docker works best on the 3.8 kernel. Precise comes with a 3.2 kernel, so we need to upgrade it. The kernel we install comes with AUFS built in.
  23. .. code-block:: bash
  24. # install the backported kernel
  25. sudo apt-get update && sudo apt-get install linux-image-generic-lts-raring
  26. # reboot
  27. sudo reboot
  28. Installation
  29. ------------
  30. Docker is available as a Ubuntu PPA (Personal Package Archive),
  31. `hosted on launchpad <https://launchpad.net/~dotcloud/+archive/lxc-docker>`_
  32. which makes installing Docker on Ubuntu very easy.
  33. .. code-block:: bash
  34. # Add the PPA sources to your apt sources list.
  35. sudo apt-get install python-software-properties && sudo add-apt-repository ppa:dotcloud/lxc-docker
  36. # Update your sources
  37. sudo apt-get update
  38. # Install, you will see another warning that the package cannot be authenticated. Confirm install.
  39. sudo apt-get install lxc-docker
  40. Verify it worked
  41. .. code-block:: bash
  42. # download the base 'ubuntu' container and run bash inside it while setting up an interactive shell
  43. docker run -i -t ubuntu /bin/bash
  44. # type 'exit' to exit
  45. **Done!**, now continue with the :ref:`hello_world` example.
  46. .. _ubuntu_raring:
  47. Ubuntu Raring 13.04 (64 bit)
  48. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  49. Dependencies
  50. ------------
  51. **AUFS filesystem support**
  52. Ubuntu Raring already comes with the 3.8 kernel, so we don't need to install it. However, not all systems
  53. have AUFS filesystem support enabled, so we need to install it.
  54. .. code-block:: bash
  55. sudo apt-get update
  56. sudo apt-get install linux-image-extra-`uname -r`
  57. **add-apt-repository support**
  58. Some installations of Ubuntu 13.04 require ``software-properties-common`` to be
  59. installed before being able to use add-apt-repository.
  60. .. code-block:: bash
  61. sudo apt-get install software-properties-common
  62. Installation
  63. ------------
  64. Docker is available as a Ubuntu PPA (Personal Package Archive),
  65. `hosted on launchpad <https://launchpad.net/~dotcloud/+archive/lxc-docker>`_
  66. which makes installing Docker on Ubuntu very easy.
  67. Add the custom package sources to your apt sources list.
  68. .. code-block:: bash
  69. # add the sources to your apt
  70. sudo add-apt-repository ppa:dotcloud/lxc-docker
  71. # update
  72. sudo apt-get update
  73. # install
  74. sudo apt-get install lxc-docker
  75. Verify it worked
  76. .. code-block:: bash
  77. # download the base 'ubuntu' container and run bash inside it while setting up an interactive shell
  78. docker run -i -t ubuntu /bin/bash
  79. # type exit to exit
  80. **Done!**, now continue with the :ref:`hello_world` example.
  81. .. _ufw:
  82. Docker and UFW
  83. ^^^^^^^^^^^^^^
  84. Docker uses a bridge to manage containers networking, by default UFW drop all `forwarding`, a first step is to enable forwarding:
  85. .. code-block:: bash
  86. sudo nano /etc/default/ufw
  87. ----
  88. # Change:
  89. # DEFAULT_FORWARD_POLICY="DROP"
  90. # to
  91. DEFAULT_FORWARD_POLICY="ACCEPT"
  92. Then reload UFW:
  93. .. code-block:: bash
  94. sudo ufw reload
  95. UFW's default set of rules denied all `incoming`, so if you want to be able to reach your containers from another host,
  96. you should allow incoming connections on the docker port (default 4243):
  97. .. code-block:: bash
  98. sudo ufw allow 4243/tcp