How to install Docker on Redhat Linux RHEL 7 - yum

Prerequisites

To install CS Docker Engine, you need root or sudo privileges and you need access to a command line on the system.

Install using a repository

Install on CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2/7.3 (YUM-based systems)

This section explains how to install on CentOS 7.1/7.2 & RHEL 7.0/7.1/7.2/7.3. Only these versions are supported. CentOS 7.0 is not supported. On RHEL, depending on your current level of updates, you may need to reboot your server to update its RHEL kernel.
  1. Add the Docker public key for CS Docker Engine packages:
    $ sudo rpm --import "https://sks-keyservers.net/pks/lookup?op=get&search=0xee6d536cf7dc86e2d7d56f59a178ac6c6238f52e"
    
    Note: If the key server above does not respond, you can try one of these:
    • pgp.mit.edu
    • keyserver.ubuntu.com
  2. Install yum-utils if necessary:
    $ sudo yum install -y yum-utils
    
  3. Add the Docker repository:
    $ sudo yum-config-manager --add-repo https://packages.docker.com/1.12/yum/repo/main/centos/7
    
    This adds the repository of the latest version of CS Docker Engine. You can customize the URL to install an older version.
  4. Install Docker CS Engine:
    • Latest version:
      $ sudo yum makecache fast
      
      $ sudo yum install docker-engine
      
    • Specific version:
      On production systems, you should install a specific version rather than relying on the latest.
      1. List the available versions:
        $ yum list docker-engine.x86_64  --showduplicates |sort -r
        
        The second column represents the version.
      2. Install a specific version by adding the version after docker-engine, separated by a hyphen (-):
        $ sudo yum install docker-engine-
        
  5. Configure devicemapper:
    By default, the devicemapper graph driver does not come pre-configured in a production-ready state. Follow the documented step by step instructions to configure devicemapper with direct-lvm for production to achieve the best performance and reliability for your environment.
  6. Configure the Docker daemon to start automatically when the system starts, and start it now.
    $ sudo systemctl enable docker.service
    $ sudo systemctl start docker.service
    
  7. Confirm the Docker daemon is running:
    $ sudo docker info
    
  8. Only users with sudo access will be able to run docker commands. Optionally, add non-sudo access to the Docker socket by adding your user to the docker group.
    $ sudo usermod -a -G docker $USER

1 comment:

Installing Ingress Controller - Kubernetes

Installing the Ingress Controller Prerequisites Make sure you have access to the Ingress controller image: For NGINX Ingress controll...