You are here: 2 Installing and Configuring > Installing and Configuring Docker

2.2 Installing and Configuring Docker

This topic provides instructions on installing and configuring Docker as part of your Moab Docker Integration. You should install and configure Docker on each Torque MOM Host.

If preemption is part of your system configuration, you will also need to repeat these steps on the host on which your local registry will reside. See also 2.5 Setting Up the Local Registry (Preemption Only).

In this topic:

2.2.1 Supported OS and Docker Versions

This topic provides steps for installing and configuring Docker on the supported combinations of operating systems and Docker versions, as shown in the table below.

Operating System Docker Version
Red Hat-based systems
CentOS 7 – Default OS Install 1.10.3
CentOS 7 – Yum Install 1.12.1
CentOS 7 – Script Install 1.12.1
Red Hat Enterprise Linux (RHEL) 7 1.12.1
SUSE-based systems
SUSE Linux Enterprise Server (SLES) 12 1.9.1

Docker is not supported for Scientific Linux.

2.2.2 Install and Configure Docker on CentOS 7

There are three methods for installing Docker on CentOS 7. The default OS install method installs Docker 1.10.3. The yum and script install methods install Docker 1.12.1 from the Docker repository. See https://docs.docker.com/engine/installation/linux/centos/.

2.2.2.A Default OS Install (for Docker 1.10.3)

Do the following:

  1. Make sure existing yum packages are up-to-date.
  2. yum update
  3. Install the Docker package.
  4. yum install docker
  5. Edit /etc/sysconfig/docker by replacing the existing OPTIONS line with the following.
  6. OPTIONS='-s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs'
  7. Start/restart Docker.
    systemctl restart docker.service
  8. Set Docker to start after reboot.
    systemctl enable docker.service
  9. Verify the installation.
    docker run hello-world
  10. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

2.2.2.B Yum Install (for Docker 1.12.1)

Do the following:

  1. Make sure existing yum packages are up-to-date.
  2. yum update
  3. Add the yum repo.
  4. tee /etc/yum.repos.d/docker.repo <<-EOF
    

    [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7/ enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF

  5. Install the Docker package.
  6. yum install docker-engine
  7. Create the service directory.
  8. mkdir /etc/systemd/system/docker.service.d
  9. In the directory you just created, create the execstart_override.conf file and add "[Service]" and "ExecStart=" as the first and second lines, respectively.
  10. From /lib/systemd/system/docker.service, copy the ExecStart line and place it as the last line in the execstart_override.conf file.
  11. In the execstart_override.conf file, append the last line to include -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs.
  12. The following is an example of the configured execstart_override.conf file for Docker 1.12.1.

    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs
    
  13. Reload the systemd manager configuration.
  14. systemctl daemon-reload
  15. Start/restart Docker.
    systemctl restart docker.service
  16. Set Docker to start after reboot.
    systemctl enable docker.service
  17. Verify the installation.
    docker run hello-world
  18. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

2.2.2.C Script Install (for Docker 1.12.1)

Do the following:

  1. Make sure existing yum packages are up-to-date.
  2. yum update
  3. Run the Docker installation script.
  4. curl -fsSL https://get.docker.com/ | sh
  5. Create the service directory.
  6. mkdir /etc/systemd/system/docker.service.d
  7. In the directory you just created, create the execstart_override.conf file and add "[Service]" and "ExecStart=" as the first and second lines, respectively.
  8. From /lib/systemd/system/docker.service, copy the ExecStart line and place it as the last line in the execstart_override.conf file.
  9. In the execstart_override.conf file, append the last line to include -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs.
  10. The following is an example of the configured execstart_override.conf file for Docker 1.12.1.

    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs
    
  11. Reload the systemd manager configuration.
  12. systemctl daemon-reload
  13. Start/restart Docker.
    systemctl restart docker.service
  14. Set Docker to start after reboot.
    systemctl enable docker.service
  15. Verify the installation.
    docker run hello-world
  16. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

2.2.3 Install and Configure Docker on RHEL 7

There are two methods for installing Docker on RHEL 7, yum install and script install. Both methods install Docker 1.12.1 from the Docker repository. See https://docs.docker.com/engine/installation/linux/rhel/.

2.2.3.A Yum Install (for Docker 1.12.1)

Do the following:

  1. Make sure existing yum packages are up-to-date.
  2. yum update
  3. Add the yum repo.
  4.                 

    tee /etc/yum.repos.d/docker.repo <<-EOF [dockerrepo] name=Docker Repository baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg EOF

  5. Install the Docker package.
  6. yum install docker-engine
  7. Create the service directory.
  8. mkdir /etc/systemd/system/docker.service.d
  9. In the directory you just created, create the execstart_override.conf file and add "[Service]" and "ExecStart=" as the first and second lines, respectively.
  10. From /lib/systemd/system/docker.service, copy the ExecStart line and place it as the last line in the execstart_override.conf file.
  11. In the execstart_override.conf file, append the last line to include -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs.
  12. The following is an example of the configured execstart_override.conf file for Docker 1.12.1.

    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs
    
  13. Reload the systemd manager configuration.
  14. systemctl daemon-reload
  15. Start/restart Docker.
    systemctl restart docker.service
  16. Set Docker to start after reboot.
    systemctl enable docker.service
  17. Verify the installation.
    docker run hello-world
  18. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

2.2.3.B Script Install (for Docker 1.12.1)

Do the following:

  1. Make sure existing yum packages are up-to-date.
  2. yum update
  3. Run the Docker installation script.
  4. curl -fsSL https://get.docker.com/ | sh
  5. Create the service directory.
  6. mkdir /etc/systemd/system/docker.service.d
  7. In the directory you just created, create the execstart_override.conf file and add "[Service]" and "ExecStart=" as the first and second lines, respectively.
  8. From /lib/systemd/system/docker.service, copy the ExecStart line and place it as the last line in the execstart_override.conf file.
  9. In the execstart_override.conf file, append the last line to include -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs.
  10. The following is an example of the configured execstart_override.conf file for Docker 1.12.1.

    [Service]
    ExecStart=
    ExecStart=/usr/bin/dockerd -s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs
    
  11. Reload the systemd manager configuration.
  12. systemctl daemon-reload
  13. Start/restart Docker.
    systemctl restart docker.service
  14. Set Docker to start after reboot.
    systemctl enable docker.service
  15. Verify the installation.
    docker run hello-world
  16. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

2.2.4 Install and Configure Docker on SLES 12

The latest supported Docker packages are inside the Container module. Do the following:

  1. Access the Docker packages by choosing one of these options.
    1. Enable the Container module.
      1. Start YaST and select Software > Software Repositories.
      2. Click Add to open the add-on dialog.
      3. Select Extensions and Module from Registration Server and click Next.
      4. From the list of available extensions and modules, select Container Module and click Next. The Container module and its repositories are added to your system.
      5. If you use Subscription Management Tool, update the list of repositories at the SMT server.
    2. Execute the following command:
  2. SUSEConnect -p sle-module-containers/12/x86_64 -r ''

    The '' following the -r flag above is two single quotes. It is necessary to avoid a limitation of SUSEConnect.

  3. Run the Docker installation script.
  4. zypper install docker
  5. Edit /etc/sysconfig/docker by replacing the existing DOCKER_OPTS line with the following.
  6. DOCKER_OPTS='-s devicemapper --storage-opt dm.fs=xfs --exec-opt native.cgroupdriver=cgroupfs'
  7. Start/restart Docker.
    systemctl restart docker.service
  8. Set Docker to start after reboot.
    systemctl enable docker.service
  9. Verify the installation.
    docker run hello-world
  10. Download any Docker images you want to make available to users on your system. For example on each MOM host:
    docker pull centos:6

© 2016 Adaptive Computing