18 KiB
		
	
	
	
	
	
			
		
		
	
	{% assign section = include.section %}
{% comment %}
Include a chunk of this file, using variables already set in the file where you want to reuse the chunk.
Usage: {% include ee-linux-install-reuse.md section="ee-install-intro" %}
{% endcomment %}
{% if section == "ee-install-intro" %}
There are two ways to install and upgrade Docker Enterprise{: target="blank" class="" } on {{ linux-dist-long }}:
- 
YUM repository: Set up a Docker repository and install Docker Engine - Enterprise from it. This is the recommended approach because installation and upgrades are managed with YUM and easier to do. 
- 
RPM package: Download the {{ package-format }} package, install it manually, and manage upgrades manually. This is useful when installing Docker Engine - Enterprise on air-gapped systems with no access to the internet. 
{% if linux-dist == "rhel" or linux-dist == "oraclelinux" %} Docker Engine - Community is not supported on {{ linux-dist-long }}. {% endif %} {% if linux-dist == "centos" %} For Docker Community Edition on {{ linux-dist-cap }}, see Get Docker Engine - Community for CentOS. {% endif %}
{% elsif section == "find-ee-repo-url" %}
To install Docker Enterprise, you will need the URL of the Docker Enterprise repository associated with your trial or subscription:
- Go to https://hub.docker.com/my-content{: target="blank" class="" }. All of your subscriptions and trials are listed.
- Click the Setup button for Docker Enterprise Edition for {{ linux-dist-long }}.
- Copy the URL from Copy and paste this URL to download your Edition and save it for later use.
You will use this URL in a later step to create a variable called, DOCKERURL.
{% elsif section == "using-yum-repo" %}
The advantage of using a repository from which to install Docker Engine - Enterprise (or any software) is that it provides a certain level of automation. RPM-based distributions such as {{ linux-dist-long }}, use a tool called YUM that work with your repositories to manage dependencies and provide automatic updates.
{% elsif section == "set-up-yum-repo" %} You only need to set up the repository once, after which you can install Docker Engine - Enterprise from the repo and repeatedly upgrade as necessary.
{% if linux-dist == "rhel" %}
- RHEL 7
- RHEL 8
```bash
$ sudo rm /etc/yum.repos.d/docker*.repo
```
- 
Temporarily store the URL (that you copied above) in an environment variable. Replace <DOCKER-EE-URL>with your URL in the following command. This variable assignment does not persist when the session ends:$ export DOCKERURL="<DOCKER-EE-URL>"
- 
Store the value of the variable, DOCKERURL(from the previous step), in ayumvariable in/etc/yum/vars/:$ sudo -E sh -c 'echo "$DOCKERURL/{{ linux-dist-url-slug }}" > /etc/yum/vars/dockerurl'Also, store your OS version string in /etc/yum/vars/dockerosversion. Most users should use7or8, but you can also use the more specific minor version, starting from7.2.$ sudo sh -c 'echo "7" > /etc/yum/vars/dockerosversion'
- 
Install required packages: yum-utilsprovides the yum-config-manager utility, anddevice-mapper-persistent-dataandlvm2are required by the devicemapper storage driver:$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
- 
Enable the extrasRHEL repository. This ensures access to thecontainer-selinuxpackage required bydocker-ee.The repository can differ per your architecture and cloud provider, so review the options in this step before running: For all architectures except IBM Power: $ sudo yum-config-manager --enable rhel-7-server-extras-rpmsFor IBM Power only (little endian): $ sudo yum-config-manager --enable extras $ sudo subscription-manager repos --enable=rhel-7-for-power-le-extras-rpms $ sudo yum makecache fast $ sudo yum -y install container-selinuxDepending on cloud provider, you may also need to enable another repository: For AWS (where REGIONis a literal, and does not represent the region your machine is running in):$ sudo yum-config-manager --enable rhui-REGION-rhel-server-extrasFor Azure: $ sudo yum-config-manager --enable rhui-rhel-7-server-rhui-extras-rpms
- 
Add the Docker Engine - Enterprise stable repository: $ sudo -E yum-config-manager \ --add-repo \ "$DOCKERURL/{{ linux-dist-url-slug }}/docker-ee.repo"
```bash
$ sudo rm /etc/yum.repos.d/docker*.repo
```
- 
Temporarily store the URL (that you copied above) in an environment variable. Replace <DOCKER-EE-URL>with your URL in the following command. This variable assignment does not persist when the session ends:$ export DOCKERURL="<DOCKER-EE-URL>"
- 
Store the value of the variable, DOCKERURL(from the previous step), in ayumvariable in/etc/yum/vars/:$ sudo -E sh -c 'echo "$DOCKERURL/{{ linux-dist-url-slug }}" > /etc/yum/vars/dockerurl'Also, store your OS version string in /etc/yum/vars/dockerosversion. Most users should use8, but you can also use the more specific minor version.$ sudo sh -c 'echo "8" > /etc/yum/vars/dockerosversion'
- 
Install required packages: yum-utilsprovides the yum-config-manager utility, anddevice-mapper-persistent-dataandlvm2are required by the devicemapper storage driver:$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
- 
Add the Docker Engine - Enterprise stable repository: $ sudo -E yum-config-manager \ --add-repo \ "$DOCKERURL/{{ linux-dist-url-slug }}/docker-ee.repo"
{% if linux-dist != "rhel" %}
- 
Remove existing Docker repositories from /etc/yum.repos.d/:$ sudo rm /etc/yum.repos.d/docker*.repo
- 
Temporarily store the URL (that you copied above) in an environment variable. Replace <DOCKER-EE-URL>with your URL in the following command. This variable assignment does not persist when the session ends:$ export DOCKERURL="<DOCKER-EE-URL>"
- 
Store the value of the variable, DOCKERURL(from the previous step), in ayumvariable in/etc/yum/vars/:$ sudo -E sh -c 'echo "$DOCKERURL/{{ linux-dist-url-slug }}" > /etc/yum/vars/dockerurl'
- 
Install required packages: yum-utilsprovides the yum-config-manager utility, anddevice-mapper-persistent-dataandlvm2are required by the devicemapper storage driver:$ sudo yum install -y yum-utils \ device-mapper-persistent-data \ lvm2
{% if linux-dist == "oraclelinux" %}
- 
Enable the ol7_addonsOracle repository. This ensures access to thecontainer-selinuxpackage required bydocker-ee.$ sudo yum-config-manager --enable ol7_addons
{% endif %}
- 
Add the Docker Engine - Enterprise stable repository: $ sudo -E yum-config-manager \ --add-repo \ "$DOCKERURL/{{ linux-dist-url-slug }}/docker-ee.repo"
{% endif %}
{% elsif section == "install-using-yum-repo" %}
Note: If you need to run Docker Engine - Enterprise 2.0, please see the following instructions:
- 
Install the latest patch release, or go to the next step to install a specific version: $ sudo yum -y install docker-ee docker-ee-cli containerd.ioIf prompted to accept the GPG key, verify that the fingerprint matches {{ gpg-fingerprint }}, and if so, accept it.
- 
To install a specific version of Docker Engine - Enterprise (recommended in production), list versions and install: a. List and sort the versions available in your repo. This example sorts results by version number, highest to lowest, and is truncated: $ sudo yum list docker-ee --showduplicates | sort -r docker-ee.x86_64 {{ site.docker_ee_version }}.ee.2-1.el7.{{ linux-dist }} docker-ee-stable-18.09The list returned depends on which repositories you enabled, and is specific to your version of {{ linux-dist-long }} (indicated by .el7in this example).b. Install a specific version by its fully qualified package name, which is the package name ( docker-ee) plus the version string (2nd column) starting at the first colon (:), up to the first hyphen, separated by a hyphen (-). For example,docker-ee-18.09.1.$ sudo yum -y install docker-ee-<VERSION_STRING> docker-ee-cli-<VERSION_STRING> containerd.ioFor example, if you want to install the 18.09 version run the following: sudo yum-config-manager --enable docker-ee-stable-18.09Docker is installed but not started. The dockergroup is created, but no users are added to the group.
- 
Start Docker: If using devicemapper, ensure it is properly configured before starting Docker, per the storage guide{: target="blank" class="" }.$ sudo systemctl start docker
- 
Verify that Docker Engine - Enterprise is installed correctly by running the hello-worldimage. This command downloads a test image, runs it in a container, prints an informational message, and exits:$ sudo docker run hello-worldDocker Engine - Enterprise is installed and running. Use sudoto run Docker commands. See Linux postinstall{: target="blank" class="" } to allow non-privileged users to run Docker commands.
{% elsif section == "upgrade-using-yum-repo" %}
- 
Follow the installation instructions and install a new version. 
{% elsif section == "package-installation" %}
To manually install Docker Enterprise, download the .{{ package-format | downcase }} file for your release. You need to download a new file each time you want to upgrade Docker Enterprise.
{% elsif section == "install-using-yum-package" %}
{% if linux-dist == "rhel" %}
- RHEL 7
- RHEL 8
- 
Enable the extrasRHEL repository. This ensures access to thecontainer-selinuxpackage which is required bydocker-ee:$ sudo yum-config-manager --enable rhel-7-server-extras-rpmsAlternately, obtain that package manually from Red Hat. There is no way to publicly browse this repository. 
- 
Go to the Docker Engine - Enterprise repository URL associated with your trial or subscription in your browser. Go to {{ linux-dist-url-slug }}/. Choose your {{ linux-dist-long }} version, architecture, and Docker version. Download the.{{ package-format | downcase }}file from thePackagesdirectory.If you have trouble with selinuxusing the packages under the7directory, try choosing the version-specific directory instead, such as7.3.
- 
Install Docker Enterprise, changing the path below to the path where you downloaded the Docker package. $ sudo yum install /path/to/package.rpmDocker is installed but not started. The dockergroup is created, but no users are added to the group.
- 
Start Docker: If using devicemapper, ensure it is properly configured before starting Docker, per the storage guide{: target="blank" class="" }.$ sudo systemctl start docker
- 
Verify that Docker Engine - Enterprise is installed correctly by running the hello-worldimage. This command downloads a test image, runs it in a container, prints an informational message, and exits:$ sudo docker run hello-worldDocker Engine - Enterprise is installed and running. Use sudoto run Docker commands. See Linux postinstall{: target="blank" class="" } to allow non-privileged users to run Docker commands.
- 
Go to the Docker Engine - Enterprise repository URL associated with your trial or subscription in your browser. Go to {{ linux-dist-url-slug }}/. Choose your {{ linux-dist-long }} version, architecture, and Docker version. Download the.{{ package-format | downcase }}file from thePackagesdirectory.If you have trouble with selinuxusing the packages under the8directory, try choosing the version-specific directory instead.
- 
Install Docker Enterprise, changing the path below to the path where you downloaded the Docker package. $ sudo yum install /path/to/package.rpmDocker is installed but not started. The dockergroup is created, but no users are added to the group.
- 
Start Docker: If using devicemapper, ensure it is properly configured before starting Docker, per the storage guide{: target="blank" class="" }.$ sudo systemctl start docker
- 
Verify that Docker Engine - Enterprise is installed correctly by running the hello-worldimage. This command downloads a test image, runs it in a container, prints an informational message, and exits:$ sudo docker run hello-worldDocker Engine - Enterprise is installed and running. Use sudoto run Docker commands. See Linux postinstall{: target="blank" class="" } to allow non-privileged users to run Docker commands.
{% endif %} {% if linux-dist != "rhel" %} {% if linux-dist == "centos" %}
- Go to the Docker Engine - Enterprise repository URL associated with your trial or subscription
in your browser. Go to {{ linux-dist-url-slug }}/7/x86_64/stable-<VERSION>/Packagesand download the.{{ package-format | downcase }}file for the Docker version you want to install. {% endif %}
{% if linux-dist == "oraclelinux" %}
- Go to the Docker Engine - Enterprise repository URL associated with your
trial or subscription in your browser. Go to
{{ linux-dist-url-slug }}/. Choose your {{ linux-dist-long }} version, architecture, and Docker version. Download the.{{ package-format | downcase }}file from thePackagesdirectory.
{% endif %}
- 
Install Docker Enterprise, changing the path below to the path where you downloaded the Docker package. $ sudo yum install /path/to/package.rpmDocker is installed but not started. The dockergroup is created, but no users are added to the group.
- 
Start Docker: If using devicemapper, ensure it is properly configured before starting Docker, per the storage guide{: target="blank" class="" }.$ sudo systemctl start docker
- 
Verify that Docker Engine - Enterprise is installed correctly by running the hello-worldimage. This command downloads a test image, runs it in a container, prints an informational message, and exits:$ sudo docker run hello-worldDocker Engine - Enterprise is installed and running. Use sudoto run Docker commands. See Linux postinstall{: target="blank" class="" } to allow non-privileged users to run Docker commands. {% endif %}
{% elsif section == "upgrade-using-yum-package" %}
- 
Download the newer package file. 
- 
Repeat the installation procedure, using yum -y upgradeinstead ofyum -y install, and point to the new file.
{% elsif section == "yum-uninstall" %}
- 
Uninstall the Docker Engine - Enterprise package: $ sudo yum -y remove docker-ee
- 
Delete all images, containers, and volumes (because these are not automatically removed from your host): $ sudo rm -rf /var/lib/docker
- 
Delete other Docker related resources: $ sudo rm -rf /run/docker $ sudo rm -rf /var/run/docker $ sudo rm -rf /etc/docker
- 
If desired, remove the devicemapperthin pool and reformat the block devices that were part of it.
You must delete any edited configuration files manually.
{% elsif section == "linux-install-nextsteps" %}
- 
Continue to Post-installation steps for Linux{: target="blank" class="" } 
- 
Continue with user guides on Universal Control Plane (UCP){: target="blank" class="" } and Docker Trusted Registry (DTR){: target="blank" class="" } 
{% endif %}