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