gentoolinux.rst 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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 Linux
  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. Installation
  19. ^^^^^^^^^^^^
  20. The package should properly pull in all the necessary dependencies and prompt
  21. for all necessary kernel options. For the most straightforward installation
  22. experience, use ``sys-kernel/aufs-sources`` as your kernel sources. If you
  23. prefer not to use ``sys-kernel/aufs-sources``, the portage tree also contains
  24. ``sys-fs/aufs3``, which includes the patches necessary for adding AUFS support
  25. to other kernel source packages such as ``sys-kernel/gentoo-sources`` (and a
  26. ``kernel-patch`` USE flag to perform the patching to ``/usr/src/linux``
  27. automatically).
  28. .. code-block:: bash
  29. sudo emerge -av app-emulation/docker
  30. If any issues arise from this ebuild or the resulting binary, including and
  31. especially missing kernel configuration flags and/or dependencies, `open an
  32. issue on the docker-overlay repository
  33. <https://github.com/tianon/docker-overlay/issues>`_ or ping tianon directly in
  34. the #docker IRC channel on the freenode network.
  35. Starting Docker
  36. ^^^^^^^^^^^^^^^
  37. Ensure that you are running a kernel that includes the necessary AUFS
  38. patches/support and includes all the necessary modules and/or configuration for
  39. LXC.
  40. OpenRC
  41. ------
  42. To start the docker daemon:
  43. .. code-block:: bash
  44. sudo /etc/init.d/docker start
  45. To start on system boot:
  46. .. code-block:: bash
  47. sudo rc-update add docker default
  48. systemd
  49. -------
  50. To start the docker daemon:
  51. .. code-block:: bash
  52. sudo systemctl start docker.service
  53. To start on system boot:
  54. .. code-block:: bash
  55. sudo systemctl enable docker.service
  56. Network Configuration
  57. ^^^^^^^^^^^^^^^^^^^^^
  58. IPv4 packet forwarding is disabled by default, so internet access from inside
  59. the container will not work unless ``net.ipv4.ip_forward`` is enabled:
  60. .. code-block:: bash
  61. sudo sysctl -w net.ipv4.ip_forward=1
  62. Or, to enable it more permanently:
  63. .. code-block:: bash
  64. echo net.ipv4.ip_forward = 1 | sudo tee /etc/sysctl.d/docker.conf