2015-06-07 23:07:20 -04:00
|
|
|
<!--[metadata]>
|
|
|
|
+++
|
|
|
|
title = "Installation on Gentoo"
|
|
|
|
description = "Installation instructions for Docker on Gentoo."
|
|
|
|
keywords = ["gentoo linux, virtualization, docker, documentation, installation"]
|
|
|
|
[menu.main]
|
|
|
|
parent = "smn_linux"
|
|
|
|
+++
|
|
|
|
<![end-metadata]-->
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
# Gentoo
|
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
Installing Docker on Gentoo Linux can be accomplished using one of two ways: the **official** way and the `docker-overlay` way.
|
|
|
|
|
|
|
|
Official project page of [Gentoo Docker](https://wiki.gentoo.org/wiki/Project:Docker) team.
|
|
|
|
|
|
|
|
## Official way
|
|
|
|
The first and recommended way if you are looking for a stable
|
|
|
|
experience is to use the official `app-emulation/docker` package directly
|
|
|
|
from the tree.
|
|
|
|
|
|
|
|
If any issues arise from this ebuild including, missing kernel
|
|
|
|
configuration flags or dependencies, open a bug
|
|
|
|
on the Gentoo [Bugzilla](https://bugs.gentoo.org) assigned to `docker AT gentoo DOT org`
|
|
|
|
or join and ask in the official
|
|
|
|
[IRC](http://webchat.freenode.net?channels=%23gentoo-containers&uio=d4) channel on the Freenode network.
|
|
|
|
|
|
|
|
## docker-overlay way
|
|
|
|
|
|
|
|
If you're looking for a `-bin` ebuild, a live ebuild, or a bleeding edge
|
|
|
|
ebuild, use the provided overlay, [docker-overlay](https://github.com/tianon/docker-overlay)
|
2014-05-27 13:08:19 -04:00
|
|
|
which can be added using `app-portage/layman`. The most accurate and
|
|
|
|
up-to-date documentation for properly installing and using the overlay
|
2014-09-29 16:59:43 -04:00
|
|
|
can be found in the [overlay](https://github.com/tianon/docker-overlay/blob/master/README.md#using-this-overlay).
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
If any issues arise from this ebuild or the resulting binary, including
|
|
|
|
and especially missing kernel configuration flags or dependencies,
|
|
|
|
open an [issue](https://github.com/tianon/docker-overlay/issues) on
|
|
|
|
the `docker-overlay` repository or ping `tianon` directly in the `#docker`
|
|
|
|
IRC channel on the Freenode network.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
### Available USE flags
|
|
|
|
|
|
|
|
| USE Flag | Default | Description |
|
|
|
|
| ------------- |:-------:|:------------|
|
|
|
|
| aufs | |Enables dependencies for the "aufs" graph driver, including necessary kernel flags.|
|
|
|
|
| btrfs | |Enables dependencies for the "btrfs" graph driver, including necessary kernel flags.|
|
|
|
|
| contrib | Yes |Install additional contributed scripts and components.|
|
|
|
|
| device-mapper | Yes |Enables dependencies for the "devicemapper" graph driver, including necessary kernel flags.|
|
|
|
|
| doc | |Add extra documentation (API, Javadoc, etc). It is recommended to enable per package instead of globally.|
|
|
|
|
| vim-syntax | |Pulls in related vim syntax scripts.|
|
|
|
|
| zsh-completion| |Enable zsh completion support.|
|
|
|
|
|
|
|
|
USE flags are described in detail on [tianon's
|
|
|
|
blog](https://tianon.github.io/post/2014/05/17/docker-on-gentoo.html).
|
|
|
|
|
2014-04-15 20:53:12 -04:00
|
|
|
The package should properly pull in all the necessary dependencies and
|
2014-09-29 16:59:43 -04:00
|
|
|
prompt for all necessary kernel options.
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-05-01 10:13:34 -04:00
|
|
|
$ sudo emerge -av app-emulation/docker
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
>Note: Sometimes there is a disparity between the latest versions
|
|
|
|
>in the official **Gentoo tree** and the **docker-overlay**.
|
|
|
|
>Please be patient, and the latest version should propagate shortly.
|
2014-08-09 14:00:29 -04:00
|
|
|
|
2014-04-15 20:53:12 -04:00
|
|
|
## Starting Docker
|
|
|
|
|
|
|
|
Ensure that you are running a kernel that includes all the necessary
|
2014-09-29 16:59:43 -04:00
|
|
|
modules and configuration (and optionally for device-mapper
|
|
|
|
and AUFS or Btrfs, depending on the storage driver you've decided to use).
|
|
|
|
|
|
|
|
To use Docker, the `docker` daemon must be running as **root**.
|
|
|
|
To use Docker as a **non-root** user, add yourself to the **docker**
|
|
|
|
group by running the following command:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
$ sudo usermod -a -G docker user
|
|
|
|
|
2014-04-15 20:53:12 -04:00
|
|
|
### OpenRC
|
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
To start the `docker` daemon:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-05-01 10:13:34 -04:00
|
|
|
$ sudo /etc/init.d/docker start
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
To start on system boot:
|
|
|
|
|
2014-05-01 10:13:34 -04:00
|
|
|
$ sudo rc-update add docker default
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
### systemd
|
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
To start the `docker` daemon:
|
2014-04-15 20:53:12 -04:00
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
$ sudo systemctl start docker
|
2014-04-15 20:53:12 -04:00
|
|
|
|
|
|
|
To start on system boot:
|
|
|
|
|
2014-09-29 16:59:43 -04:00
|
|
|
$ sudo systemctl enable docker
|
2014-11-25 23:09:52 -05:00
|
|
|
|
|
|
|
If you need to add an HTTP Proxy, set a different directory or partition for the
|
|
|
|
Docker runtime files, or make other customizations, read our systemd article to
|
2015-10-09 19:50:41 -04:00
|
|
|
learn how to [customize your systemd Docker daemon options](../articles/systemd.md).
|
2015-04-29 15:51:57 -04:00
|
|
|
|
|
|
|
## Uninstallation
|
|
|
|
|
|
|
|
To uninstall the Docker package:
|
|
|
|
|
|
|
|
$ sudo emerge -cav app-emulation/docker
|
|
|
|
|
|
|
|
To uninstall the Docker package and dependencies that are no longer needed:
|
|
|
|
|
|
|
|
$ sudo emerge -C app-emulation/docker
|
|
|
|
|
|
|
|
The above commands will not remove images, containers, volumes, or user created
|
|
|
|
configuration files on your host. If you wish to delete all images, containers,
|
|
|
|
and volumes run the following command:
|
|
|
|
|
|
|
|
$ rm -rf /var/lib/docker
|
|
|
|
|
|
|
|
You must delete the user created configuration files manually.
|