github.com/vincentwoo/docker@v0.7.3-0.20160116130405-82401a4b13c0/docs/installation/fedora.md (about)

     1  <!--[metadata]>
     2  +++
     3  title = "Installation on Fedora"
     4  description = "Instructions for installing Docker on Fedora."
     5  keywords = ["Docker, Docker documentation, Fedora, requirements,  linux"]
     6  [menu.main]
     7  parent = "smn_linux"
     8  weight=-3
     9  +++
    10  <![end-metadata]-->
    11  
    12  # Fedora
    13  
    14  Docker is supported on Fedora version 22 and 23. This page instructs you to install
    15  using Docker-managed release packages and installation mechanisms. Using these
    16  packages ensures you get the latest release of Docker. If you wish to install
    17  using Fedora-managed packages, consult your Fedora release documentation for
    18  information on Fedora's Docker support.
    19  
    20  ## Prerequisites
    21  
    22  Docker requires a 64-bit installation regardless of your Fedora version. Also, your kernel must be 3.10 at minimum. To check your current kernel
    23  version, open a terminal and use `uname -r` to display your kernel version:
    24  
    25      $ uname -r
    26      3.19.5-100.fc21.x86_64
    27  
    28  If your kernel is at a older version, you must update it.
    29  
    30  Finally, is it recommended that you fully update your system. Please keep in
    31  mind that your system should be fully patched to fix any potential kernel bugs. Any
    32  reported kernel bugs may have already been fixed on the latest kernel packages
    33  
    34  
    35  ## Install
    36  
    37  There are two ways to install Docker Engine.  You can install with the `dnf` package manager. Or you can use `curl` with the  `get.docker.com` site. This second method runs an installation script which also installs via the `dnf` package manager.
    38  
    39  ### Install with DNF
    40  
    41  1. Log into your machine as a user with `sudo` or `root` privileges.
    42  
    43  2. Make sure your existing dnf packages are up-to-date.
    44  
    45  		$ sudo dnf update
    46  
    47  3. Add the yum repo yourself.
    48  
    49          $ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
    50          [dockerrepo]
    51          name=Docker Repository
    52          baseurl=https://yum.dockerproject.org/repo/main/fedora/$releasever/
    53          enabled=1
    54          gpgcheck=1
    55          gpgkey=https://yum.dockerproject.org/gpg
    56          EOF
    57  
    58  4. Install the Docker package.
    59  
    60          $ sudo dnf install docker-engine
    61  
    62  5. Start the Docker daemon.
    63  
    64  		$ sudo systemctl start docker
    65  
    66  6. Verify `docker` is installed correctly by running a test image in a container.
    67  
    68  
    69          $ sudo docker run hello-world
    70          Unable to find image 'hello-world:latest' locally
    71          latest: Pulling from hello-world
    72          a8219747be10: Pull complete
    73          91c95931e552: Already exists
    74          hello-world:latest: The image you are pulling has been verified. Important: image verification is a tech preview feature and should not be relied on to provide security.
    75          Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd1.7.1cf5daeb82aab55838d
    76          Status: Downloaded newer image for hello-world:latest
    77          Hello from Docker.
    78          This message shows that your installation appears to be working correctly.
    79  
    80          To generate this message, Docker took the following steps:
    81           1. The Docker client contacted the Docker daemon.
    82           2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
    83              (Assuming it was not already locally available.)
    84           3. The Docker daemon created a new container from that image which runs the
    85              executable that produces the output you are currently reading.
    86           4. The Docker daemon streamed that output to the Docker client, which sent it
    87              to your terminal.
    88  
    89          To try something more ambitious, you can run an Ubuntu container with:
    90           $ docker run -it ubuntu bash
    91  
    92          For more examples and ideas, visit:
    93           http://docs.docker.com/userguide/
    94  
    95  
    96  ### Install with the script
    97  
    98  
    99  1. Log into your machine as a user with `sudo` or `root` privileges.
   100  
   101  2. Make sure your existing dnf packages are up-to-date.
   102  
   103  		$ sudo dnf update
   104  
   105  3. Run the Docker installation script.
   106  
   107  		$ curl -fsSL https://get.docker.com/ | sh
   108  
   109  	This script adds the `docker.repo` repository and installs Docker.
   110  
   111  4. Start the Docker daemon.
   112  
   113          $ sudo systemctl start docker
   114  
   115  5. Verify `docker` is installed correctly by running a test image in a container.
   116  
   117  		$ sudo docker run hello-world
   118  
   119  ## Create a docker group
   120  
   121  The `docker` daemon binds to a Unix socket instead of a TCP port. By default
   122  that Unix socket is owned by the user `root` and other users can access it with
   123  `sudo`. For this reason, `docker` daemon always runs as the `root` user.
   124  
   125  To avoid having to use `sudo` when you use the `docker` command, create a Unix
   126  group called `docker` and add users to it. When the `docker` daemon starts, it
   127  makes the ownership of the Unix socket read/writable by the `docker` group.
   128  
   129  >**Warning**: The `docker` group is equivalent to the `root` user; For details
   130  >on how this impacts security in your system, see [*Docker Daemon Attack
   131  >Surface*](../security/security.md#docker-daemon-attack-surface) for details.
   132  
   133  To create the `docker` group and add your user:
   134  
   135  1. Log into your system as a user with `sudo` privileges.
   136  
   137  2. Create the `docker` group and add your user.
   138  
   139      `sudo usermod -aG docker your_username`
   140  
   141  3. Log out and log back in.
   142  
   143      This ensures your user is running with the correct permissions.
   144  
   145  4. Verify your work by running `docker` without `sudo`.
   146  
   147          $ docker run hello-world
   148  
   149  ## Start the docker daemon at boot
   150  
   151  To ensure Docker starts when you boot your system, do the following:
   152  
   153      $ sudo systemctl enable docker
   154  
   155  If you need to add an HTTP Proxy, set a different directory or partition for the
   156  Docker runtime files, or make other customizations, read our Systemd article to
   157  learn how to [customize your Systemd Docker daemon options](../articles/systemd.md).
   158  
   159  ## Running Docker with a manually-defined network
   160  
   161  If you manually configure your network using `systemd-network` with `systemd` version 219 or higher, containers you start with Docker may be unable to access your network.
   162  Beginning with version 220, the forwarding setting for a given network (`net.ipv4.conf.<interface>.forwarding`) defaults to *off*. This setting prevents IP forwarding. It also conflicts with Docker which enables the `net.ipv4.conf.all.forwarding` setting within a container.
   163  
   164  To work around this, edit the `<interface>.network` file in
   165  `/usr/lib/systemd/network/` on your Docker host  (ex: `/usr/lib/systemd/network/80-container-host0.network`) add the following block:
   166  
   167  ```
   168  [Network]
   169  ...
   170  IPForward=kernel
   171  # OR
   172  IPForward=true
   173  ...
   174  ```
   175  
   176  This configuration allows IP forwarding from the container as expected.
   177  
   178  ## Uninstall
   179  
   180  You can uninstall the Docker software with `dnf`.
   181  
   182  1. List the package you have installed.
   183  
   184  		$ dnf list installed | grep docker dnf list installed | grep docker
   185  		docker-engine.x86_64     1.7.1-0.1.fc21 @/docker-engine-1.7.1-0.1.fc21.el7.x86_64
   186  
   187  2. Remove the package.
   188  
   189  		$ sudo dnf -y remove docker-engine.x86_64
   190  
   191  	This command does not remove images, containers, volumes, or user-created
   192  	configuration files on your host.
   193  
   194  3. To delete all images, containers, and volumes, run the following command:
   195  
   196  		$ rm -rf /var/lib/docker
   197  
   198  4. Locate and delete any user-created configuration files.