github.com/circular-dark/docker@v1.7.0/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  +++
     9  <![end-metadata]-->
    10  
    11  # Fedora
    12  
    13  Docker is supported on the following versions of Fedora:
    14  
    15  - Fedora 20 
    16  - Fedora 21
    17  - Fedora 22 
    18  
    19  This page instructs you to install using Docker-managed release packages and
    20  installation mechanisms. Using these packages ensures you get the latest release
    21  of Docker. If you wish to install using Fedora-managed packages, consult your
    22  Fedora release documentation for information on Fedora's Docker support.
    23  
    24  ##Prerequisites
    25  
    26  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
    27  version, open a terminal and use `uname -r` to display your kernel version:
    28  
    29      $ uname -r 
    30      3.19.5-100.fc20.x86_64
    31  
    32  If your kernel is at a older version, you must update it.
    33  
    34  Finally, is it recommended that you fully update your system. Please keep in
    35  mind that your system should be fully patched to fix any potential kernel bugs. Any
    36  reported kernel bugs may have already been fixed on the latest kernel packages 
    37  
    38  
    39  ## Install
    40  
    41  You use the same installation procedure for all versions of Fedora,
    42  only the package you install differs. There are two packages to choose from:
    43  
    44  <table>
    45    <tr>
    46      <th>Version</th>
    47      <th>Package name</th>
    48    </tr>
    49    <tr>
    50      <td>Fedora 20</td>
    51      <td>
    52      <p>
    53      <a href="https://get.docker.com/rpm/1.7.0/fedora-20/RPMS/x86_64/docker-engine-1.7.0-1.fc20.x86_64.rpm">
    54      https://get.docker.com/rpm/1.7.0/fedora-20/RPMS/x86_64/docker-engine-1.7.0-1.fc20.x86_64.rpm</a>
    55          </p>
    56      </td>
    57          <p>
    58      <a href="https://get.docker.com/rpm/1.7.0/fedora-20/SRPMS/docker-engine-1.7.0-1.fc20.src.rpm">
    59      https://get.docker.com/rpm/1.7.0/fedora-20/SRPMS/docker-engine-1.7.0-1.fc20.src.rpm/a>
    60          </p>
    61      </td>
    62    </tr>
    63    <tr>
    64      <td>Fedora 21</td>
    65      <td>
    66      <p>
    67      <a href="https://get.docker.com/rpm/1.7.0/fedora-21/RPMS/x86_64/docker-engine-1.7.0-1.fc21.x86_64.rpm">
    68      https://get.docker.com/rpm/1.7.0/fedora-21/RPMS/x86_64/docker-engine-1.7.0-1.fc21.x86_64.rpm</a>
    69          </p>
    70      </td>
    71          <p>
    72      <a href="https://get.docker.com/rpm/1.7.0/fedora-21/SRPMS/docker-engine-1.7.0-1.fc21.src.rpm">
    73      https://get.docker.com/rpm/1.7.0/fedora-21/SRPMS/docker-engine-1.7.0-1.fc21.src.rpm/a>
    74          </p>
    75      </td>
    76    </tr>
    77     <tr>
    78      <td>Fedora 22</td>
    79      <td>
    80      <p>
    81      <a href="https://get.docker.com/rpm/1.7.0/fedora-22/RPMS/x86_64/docker-engine-1.7.0-1.fc22.x86_64.rpm">
    82      https://get.docker.com/rpm/1.7.0/fedora-22/RPMS/x86_64/docker-engine-1.7.0-1.fc22.x86_64.rpm</a>
    83          </p>
    84      </td>
    85          <p>
    86      <a href="https://get.docker.com/rpm/1.7.0/fedora-22/SRPMS/docker-engine-1.7.0-1.fc22.src.rpm">
    87      https://get.docker.com/rpm/1.7.0/fedora-22/SRPMS/docker-engine-1.7.0-1.fc22.src.rpm/a>
    88          </p>
    89      </td>
    90    </tr> 
    91  </table>
    92  
    93  
    94  This procedure depicts an installation on version 21. If you are installing on
    95  20 or 22, substitute that package for your installation. 
    96  
    97  1. Log into your machine as a user with `sudo` or `root` privileges.
    98  
    99  2. Make sure you don't have an older version of Docker installed.
   100  
   101  		$ yum list installed | grep docker
   102  	  
   103  	If you have an older version, remove it using the `yum -y remove <packagename>` command.
   104  
   105  3. Download the Docker RPM to the current directory.
   106  		
   107  		$ curl -O -sSL https://url_to_package/docker-engine-1.7.0-0.1.fc21.x86_64.rpm
   108  
   109  4. Use `yum` to install the package.
   110  
   111  		$ sudo yum localinstall --nogpgcheck docker-engine-1.7.0-0.1.fc21.x86_64.rpm
   112  
   113  5. Start the Docker daemon.
   114  
   115  		$ sudo service docker start
   116  
   117  6. Verify `docker` is installed correctly by running a test image in a container.
   118  
   119  		$ sudo docker run hello-world
   120  		Unable to find image 'hello-world:latest' locally
   121  		latest: Pulling from hello-world
   122  		a8219747be10: Pull complete 
   123  		91c95931e552: Already exists 
   124  		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.
   125  		Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d
   126  		Status: Downloaded newer image for hello-world:latest
   127  		Hello from Docker.
   128  		This message shows that your installation appears to be working correctly.
   129  
   130  		To generate this message, Docker took the following steps:
   131  		 1. The Docker client contacted the Docker daemon.
   132  		 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
   133  				(Assuming it was not already locally available.)
   134  		 3. The Docker daemon created a new container from that image which runs the
   135  				executable that produces the output you are currently reading.
   136  		 4. The Docker daemon streamed that output to the Docker client, which sent it
   137  				to your terminal.
   138  
   139  		To try something more ambitious, you can run an Ubuntu container with:
   140  		 $ docker run -it ubuntu bash
   141  
   142  		For more examples and ideas, visit:
   143  		 http://docs.docker.com/userguide/
   144   
   145  ## Create a docker group		
   146  
   147  The `docker` daemon binds to a Unix socket instead of a TCP port. By default
   148  that Unix socket is owned by the user `root` and other users can access it with
   149  `sudo`. For this reason, `docker` daemon always runs as the `root` user.
   150  
   151  To avoid having to use `sudo` when you use the `docker` command, create a Unix
   152  group called `docker` and add users to it. When the `docker` daemon starts, it
   153  makes the ownership of the Unix socket read/writable by the `docker` group.
   154  
   155  >**Warning**: The `docker` group is equivalent to the `root` user; For details
   156  >on how this impacts security in your system, see [*Docker Daemon Attack
   157  >Surface*](/articles/security/#docker-daemon-attack-surface) for details.
   158  
   159  To create the `docker` group and add your user:
   160  
   161  1. Log into your system as a user with `sudo` privileges.
   162  
   163  2. Create the `docker` group and add your user.
   164  
   165      `sudo usermod -aG docker your_username`
   166  
   167  3. Log out and log back in.
   168  
   169      This ensures your user is running with the correct permissions.
   170  
   171  4. Verify your work by running `docker` without `sudo`.
   172  
   173          $ docker run hello-world
   174  				Unable to find image 'hello-world:latest' locally
   175  				latest: Pulling from hello-world
   176  				a8219747be10: Pull complete 
   177  				91c95931e552: Already exists 
   178  				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.
   179  				Digest: sha256:aa03e5d0d5553b4c3473e89c8619cf79df368babd18681cf5daeb82aab55838d
   180  				Status: Downloaded newer image for hello-world:latest
   181  				Hello from Docker.
   182  				This message shows that your installation appears to be working correctly.
   183  
   184  				To generate this message, Docker took the following steps:
   185  				 1. The Docker client contacted the Docker daemon.
   186  				 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
   187  						(Assuming it was not already locally available.)
   188  				 3. The Docker daemon created a new container from that image which runs the
   189  						executable that produces the output you are currently reading.
   190  				 4. The Docker daemon streamed that output to the Docker client, which sent it
   191  						to your terminal.
   192  
   193  				To try something more ambitious, you can run an Ubuntu container with:
   194  				 $ docker run -it ubuntu bash
   195  
   196  				For more examples and ideas, visit:
   197  				 http://docs.docker.com/userguide/
   198   
   199  ## Start the docker daemon at boot
   200  
   201  To ensure Docker starts when you boot your system, do the following:
   202  
   203      $ sudo chkconfig docker on
   204  
   205  If you need to add an HTTP Proxy, set a different directory or partition for the
   206  Docker runtime files, or make other customizations, read our Systemd article to
   207  learn how to [customize your Systemd Docker daemon options](/articles/systemd/).
   208  
   209  
   210  ## Uninstall
   211  
   212  You can uninstall the Docker software with `yum`.  
   213  
   214  1. List the package you have installed.
   215  
   216  		$ yum list installed | grep docker
   217  		yum list installed | grep docker
   218  		docker-engine.x86_64                1.7.0-0.1.fc20
   219  																																								 @/docker-engine-1.7.0-0.1.fc20.el6.x86_64
   220  
   221  2. Remove the package.
   222  
   223  		$ sudo yum -y remove docker-engine.x86_64 
   224  
   225  	This command does not remove images, containers, volumes, or user-created
   226  	configuration files on your host. 
   227  
   228  3. To delete all images, containers, and volumes, run the following command:
   229  
   230  		$ rm -rf /var/lib/docker
   231  
   232  4. Locate and delete any user-created configuration files.