1
0
mirror of https://github.com/docker/docs.git synced 2026-11-05 00:14:17 +03:00
Files
docs/install.md
Sven Dowideit b199d44679 Simplify the menu text and fix some links
Signed-off-by: Sven Dowideit <SvenDowideit@home.org.au>
2015-06-19 14:54:35 -07:00

15 KiB

Install Docker Trusted Registry

This document describes the process of obtaining, installing, and securing Docker Trusted Registry (DTR). DTR is installed from Docker containers. Once installed, you will need to select a method of securing it. This doc will explain the options you have for security and help you find the resources needed to configure it according to your chosen method. More configuration details can be found in the DTR Configuration page.

Specifically, installation requires completion of these steps, in order:

  1. Acquire a license by purchasing DTR or requesting a trial license.
  2. Install the commercially supported Docker Engine.
  3. Install DTR
  4. Add your license to your DTR instance

Licensing

In order to run DTR, you will need to acquire a license, either by purchasing DTR or requesting a trial license. The license will be associated with your Docker Hub account or Docker Hub organization (so if you don't have an account, you'll need to set one up, which can be done at the same time as your license request). To get your license or start your trial, please contact our sales department. Upon completion of your purchase or request, you will receive an email with further instructions for licensing your copy of DTR.

Prerequisites

DTR 1.0.1 requires the following:

  • Commercially supported Docker Engine 1.6.1 or later running on an Ubuntu 14.04 LTS, RHEL 7.1 or RHEL 7.0 host. (See below for instructions on how to install the commercially supported Docker Engine.)

Note: In order to remain in compliance with your DTR support agreement, you must use the current version of commercially supported Docker Engine. Running the regular, open source version of Engine is not supported.

  • Your Docker daemon needs to be listening to the Unix socket (the default) so that it can be bind-mounted into the DTR management containers, allowing DTR to manage itself and its updates. For this reason, your DTR host will also need internet connectivity so it can access the updates.

  • Your host also needs to have TCP ports 80 and 443 available for the DTR container port mapping.

  • You will also need the Docker Hub user-name and password used when obtaining the DTR license (or the user-name of an administrator of the Hub organization that obtained an Enterprise license).

Installing the Commercially Supported Docker Engine

Since DTR is installed using Docker, the commercially supported Docker Engine must be installed first. This is done with an RPM or DEB repository, which you set up using a Bash script downloaded from the Docker Hub.

Download the commercially supported Docker Engine installation script

To download the commercially supported Docker Engine Bash installation script, log in to the Docker Hub with the user-name used to obtain your license . Once you're logged in, go to the "Enterprise Licenses" page in your Hub account's "Settings" section.

Select your intended host operating system from the "Download CS Engine" drop- down at the top right of the page and then, once the Bash setup script is downloaded, follow the steps below appropriate for your chosen OS.

Docker Hub Docker engine install dropdown

RHEL 7.0/7.1 installation

First, copy the downloaded Bash setup script to your RHEL host. Next, run the following to install commercially supported Docker Engine and its dependencies, and then start the Docker daemon:

$ sudo yum update && sudo yum upgrade
$ chmod 755 docker-cs-engine-rpm.sh
$ sudo ./docker-cs-engine-rpm.sh
$ sudo yum install docker-engine-cs
$ sudo systemctl enable docker.service
$ sudo systemctl start docker.service

In order to simplify using Docker, you can get non-sudo access to the Docker socket by adding your user to the docker group, then logging out and back in again:

$ sudo usermod -a -G docker $USER
$ exit

Note

: you may need to reboot your server to update its RHEL kernel.

Ubuntu 14.04 LTS installation

First, copy the downloaded Bash setup script to your Ubuntu host. Next, run the following to install commercially supported Docker Engine and its dependencies:

$ sudo apt-get update && sudo apt-get upgrade
$ sudo apt-get install -y linux-image-extra-virtual
$ sudo reboot
$ chmod 755 docker-cs-engine-deb.sh
$ sudo ./docker-cs-engine-deb.sh
$ sudo apt-get install docker-engine-cs

Lastly, confirm Docker is running with sudo service docker start.

In order to simplify using Docker, you can get non-sudo access to the Docker socket by adding your user to the docker group, then logging out and back in again:

$ sudo usermod -a -G docker $USER
$ exit

Note

: you may need to reboot your server to update its LTS kernel.

Upgrading the Commercially Supported Docker Engine

CS Docker Engine 1.6.1 contains fixes to security vulnerabilities, and customers should upgrade to it immediately.

Note

: If you have CS Docker Engine 1.6.0 installed, it must be upgraded; however, due to compatibility issues, DTR must be upgraded first.

The CS Docker Engine installation script set up the RHEL/Ubuntu package repositories, so upgrading the Engine only requires you to run the update commands on your server.

RHEL 7.0/7.1 upgrade

The following commands will stop the running DTR, upgrade CS Docker Engine, and then start DTR again:

    $ sudo bash -c "$(sudo docker run docker/trusted-registry stop)"
    $ sudo yum update
    $ sudo systemctl daemon-reload && sudo systemctl restart docker
    $ sudo bash -c "$(sudo docker run docker/trusted-registry start)"

Ubuntu 14.04 LTS upgrade

The following commands will stop the running DTR, upgrade CS Docker Engine, and then start DTR again:

    $ sudo bash -c "$(sudo docker run docker/trusted-registry stop)"
    $ sudo apt-get update && sudo apt-get dist-upgrade docker-engine-cs
    $ sudo bash -c "$(sudo docker run docker/trusted-registry start)"

Installing Docker Trusted Registry

Once the commercially supported Docker Engine is installed, you can install DTR itself. DTR is a self-installing application built and distributed using Docker and the Docker Hub. It is able to restart and reconfigure itself using the Docker socket that is bind-mounted to its container.

Start installing DTR by running the "docker/trusted-registry" container:

	$ sudo bash -c "$(sudo docker run docker/trusted-registry install)"

Note

: sudo is needed for docker/trusted-registry commands to ensure that the Bash script is run with full access to the Docker host.

You can also find this command on the "Enterprise Licenses" section of your Hub user profile. The command will execute a shell script that creates the needed directories and then runs Docker to pull DTR's images and run its containers.

Depending on your internet connection, this process may take several minutes to complete.

A successful installation will pull a large number of Docker images and should display output similar to:

$ sudo bash -c "$(sudo docker run docker/trusted-registry install)"
Unable to find image 'docker/trusted-registry:latest' locally
Pulling repository docker/trusted-registry
c46d58daad7d: Pulling image (latest) from docker/trusted-registry
c46d58daad7d: Pulling image (latest) from docker/trusted-registry
c46d58daad7d: Pulling dependent layers
511136ea3c5a: Download complete
fa4fd76b09ce: Pulling metadata
fa4fd76b09ce: Pulling fs layer
ff2996b1faed: Download complete
...
fd7612809d57: Pulling metadata
fd7612809d57: Pulling fs layer
fd7612809d57: Download complete
c46d58daad7d: Pulling metadata
c46d58daad7d: Pulling fs layer
c46d58daad7d: Download complete
c46d58daad7d: Download complete
Status: Downloaded newer image for docker/trusted-registry:latest
Unable to find image 'docker/trusted-registry:1.0.0_8ce62a61e058' locally
Pulling repository docker/trusted-registry
c46d58daad7d: Download complete
511136ea3c5a: Download complete
fa4fd76b09ce: Download complete
1c8294cc5160: Download complete
117ee323aaa9: Download complete
2d24f826cb16: Download complete
33bfc1956932: Download complete
48f0dd6c9414: Download complete
65c30f72ecb2: Download complete
d4b29764d0d3: Download complete
5654f4fe5384: Download complete
9b9faa6ecd11: Download complete
0c275f56ca5c: Download complete
ff2996b1faed: Download complete
fd7612809d57: Download complete
Status: Image is up to date for docker/trusted-registry:1.0.0_8ce62a61e058
INFO  [1.0.0_8ce62a61e058] Attempting to connect to docker engine dockerHost="unix:///var/run/docker.sock"
INFO  [1.0.0_8ce62a61e058] Running install command
<...output truncated...>
Creating container docker_trusted_registry_load_balancer with docker daemon unix:///var/run/docker.sock
Starting container docker_trusted_registry_load_balancer with docker daemon unix:///var/run/docker.sock
Bringing up docker_trusted_registry_log_aggregator.
Creating container docker_trusted_registry_log_aggregator with docker daemon unix:///var/run/docker.sock
Starting container docker_trusted_registry_log_aggregator with docker daemon unix:///var/run/docker.sock
$ docker ps
CONTAINER ID        IMAGE                                                   COMMAND                CREATED             STATUS         PORTS                                      NAMES
0168f37b6221        docker/trusted-registry-log-aggregator:1.0.0_8ce62a61e058   "log-aggregator"       4 seconds ago       Up 4 seconds                                              docker_trusted_registry_log_aggregator
b51c73bebe8b        docker/trusted-registry-nginx:1.0.0_8ce62a61e058            "nginxWatcher"         4 seconds ago       Up 4 seconds   0.0.0.0:80->80/tcp, 0.0.0.0:443->443/tcp   docker_trusted_registry_load_balancer
e8327864356b        docker/trusted-registry-admin-server:1.0.0_8ce62a61e058     "server"               5 seconds ago       Up 5 seconds   80/tcp                                     docker_trusted_registry_admin_server
52885a6e830a        docker/trusted-registry-auth_server:alpha-a5a2af8a555e      "garant --authorizat   6 seconds ago       Up 5 seconds   8080/tcp

Once this process completes, you should be able to manage and configure your DTR instance by pointing your browser to https://<host-ip>/.

Your browser will warn you that this is an unsafe site, with a self-signed, untrusted certificate. This is normal and expected; allow this connection temporarily.

Setting the DTR Domain Name

The DTR Administrator site will also warn that the "Domain Name" is not set. Go to the "Settings" tab, and set the "Domain Name" to the full host-name of your DTR server. Hitting the "Save and Restart DTR Server" button will generate a new certificate, which will be used by both the DTR Administrator web interface and the DTR Registry server.

After the server restarts, you will again need to allow the connection to the untrusted DTR web admin site.

http settings page</admin/settings#http>

Lastly, you will see a warning notifying you that this instance of DTR is unlicensed. You'll correct this in the next step.

Add your license

The DTR registry services will not start until you add your license. To do that, you'll first download your license from the Docker Hub and then upload it to your DTR web admin server. Follow these steps:

  1. If needed, log back into the Docker Hub using the user-name you used when obtaining your license. Go to "Settings" (in the menu under your user-name, top right) to get to your account settings, and then click on "Enterprise Licenses" in the side bar at left.

  2. You'll see a list of available licenses. Click on the download button to obtain the license file you'd like to use. Download DTR license

  3. Next, go to your DTR instance in your browser and click on the Settings tab and then the "License" tab. Click on the "Upload license file" button, which will open a standard file browser. Locate and select the license file you downloaded in step 2, above. Approve the selection to close the dialog. http settings page</admin/settings#license>

  4. Click the "Save and Restart DTR" button, which will quit DTR and then restart it, registering the new license.

  5. Verify the acceptance of the license by confirming that the "unlicensed copy" warning is no longer present.

Securing DTR

Securing DTR is required. You will not be able to push or pull from DTR until you secure it.

There are several options and methods for securing DTR. For more information, see the configuration documentation

Using DTR to push and pull images

Now that you have DTR configured with a "Domain Name" and have your client Docker daemons configured with the required security settings, you can test your setup by following the instructions for Using DTR to Push and pull images.

DTR web interface and registry authentication

By default, there is no authentication set on either the DTR web admin interface or the DTR registry. You can restrict access using an in-DTR configured set of users (and passwords), or you can configure DTR to use LDAP- based authentication.

See DTR Authentication settings for more details.

Upgrading Docker Trusted Registry

DTR has been designed to allow on-the-fly software upgrades. Start by clicking on the "System Health" tab. In the upper, right-hand side of the dashboard, below the navigation bar, you'll see the currently installed version (e.g., Current Version: 0.1.12345).

If your DTR instance is the latest available, you will also see the message: "System Up to Date."

If there is an upgrade available, you will see the message "System Update Available!" alongside a button labeled "Update to Version X.XX". To upgrade, DTR will pull new DTR container images from the Docker Hub. If you have not already connected to Docker Hub, DTR will prompt you to log in.

The upgrade process requires a small amount of downtime to complete. To complete the upgrade, DTR will:

  • Connect to the Docker Hub to pull new container images with the new version of DTR.
  • Deploy those containers
  • Shut down the old containers
  • Resolve any necessary links/urls.

Assuming you have a decent internet connection, the entire upgrade process should complete within a few minutes.

You should now upgrade CS Docker Engine.

Note

: If Docker engine is upgraded first (DTR 1.0.0 on CS Docker Engine 1.6.1), DTR can still be upgraded from the command line by running:

sudo bash -c "$(sudo docker run docker/trusted-registry:1.0.0 upgrade 1.0.1)"

Next Steps

For information on configuring DTR for your environment, take a look at the Configuration instructions.