gentoolinux.rst 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. :title: Installation on Gentoo Linux
  2. :description: Docker installation instructions and nuances for Gentoo Linux.
  3. :keywords: gentoo linux, virtualization, docker, documentation, installation
  4. .. _gentoo_linux:
  5. Gentoo
  6. ======
  7. .. include:: install_header.inc
  8. .. include:: install_unofficial.inc
  9. Installing Docker on Gentoo Linux can be accomplished using one of two methods.
  10. The first and best way if you're looking for a stable experience is to use the
  11. official `app-emulation/docker` package directly in the portage tree.
  12. If you're looking for a ``-bin`` ebuild, a live ebuild, or bleeding edge
  13. ebuild changes/fixes, the second installation method is to use the overlay
  14. provided at https://github.com/tianon/docker-overlay which can be added using
  15. ``app-portage/layman``. The most accurate and up-to-date documentation for
  16. properly installing and using the overlay can be found in `the overlay README
  17. <https://github.com/tianon/docker-overlay/blob/master/README.md#using-this-overlay>`_.
  18. Note that sometimes there is a disparity between the latest version and what's
  19. in the overlay, and between the latest version in the overlay and what's in the
  20. portage tree. Please be patient, and the latest version should propagate
  21. shortly.
  22. Installation
  23. ^^^^^^^^^^^^
  24. The package should properly pull in all the necessary dependencies and prompt
  25. for all necessary kernel options. The ebuilds for 0.7+ include use flags to
  26. pull in the proper dependencies of the major storage drivers, with the
  27. "device-mapper" use flag being enabled by default, since that is the simplest
  28. installation path.
  29. .. code-block:: bash
  30. sudo emerge -av app-emulation/docker
  31. If any issues arise from this ebuild or the resulting binary, including and
  32. especially missing kernel configuration flags and/or dependencies, `open an
  33. issue on the docker-overlay repository
  34. <https://github.com/tianon/docker-overlay/issues>`_ or ping tianon directly in
  35. the #docker IRC channel on the freenode network.
  36. Starting Docker
  37. ^^^^^^^^^^^^^^^
  38. Ensure that you are running a kernel that includes all the necessary modules
  39. and/or configuration for LXC (and optionally for device-mapper and/or AUFS,
  40. depending on the storage driver you've decided to use).
  41. OpenRC
  42. ------
  43. To start the docker daemon:
  44. .. code-block:: bash
  45. sudo /etc/init.d/docker start
  46. To start on system boot:
  47. .. code-block:: bash
  48. sudo rc-update add docker default
  49. systemd
  50. -------
  51. To start the docker daemon:
  52. .. code-block:: bash
  53. sudo systemctl start docker.service
  54. To start on system boot:
  55. .. code-block:: bash
  56. sudo systemctl enable docker.service
  57. Network Configuration
  58. ^^^^^^^^^^^^^^^^^^^^^
  59. IPv4 packet forwarding is disabled by default, so internet access from inside
  60. the container will not work unless ``net.ipv4.ip_forward`` is enabled:
  61. .. code-block:: bash
  62. sudo sysctl -w net.ipv4.ip_forward=1
  63. Or, to enable it more permanently:
  64. .. code-block:: bash
  65. echo net.ipv4.ip_forward = 1 | sudo tee /etc/sysctl.d/docker.conf