Chapter 3. Installing Red Hat Quay (basic)

Note

This installation process is only for POC purposes and is not intended for use as a production install.

3.1. Prerequisites

For a Red Hat Quay Registry installation (appropriate for non-production purposes), you need one system (physical or virtual machine) that has the following attributes:

  • Red Hat Enterprise Linux (RHEL): Obtain the latest Red Hat Enterprise Linux server media from the Downloads page and follow instructions from the Red Hat Enterprise Linux 7 Installation Guide.
  • Valid Red Hat Subscription: Obtain a valid Red Hat Enterprise Linux server subscription.
  • CPUs: Two or more virtual CPUs
  • RAM: 4GB or more
  • Disk space: (dependant on storage needs for registry)

    • About 30GB of disk space should be enough for a test system (broken down in the following manner):
    • At least 10GB of disk space for the operating system (Red Hat Enterprise Linux Server).
    • At least 10GB of disk space for docker storage (to run 3 containers)
    • At least 10GB of disk space for Quay local storage (CEPH or other local storage might require more memory)

3.2. Starting up the services

Follow these steps to install Red Hat Quay on a single system (VM or bare metal).

  1. Install Red Hat Enterprise Linux server: Install the latest RHEL server. You can do a Minimal install (shell access only) or Server plus GUI (if you want a desktop).
  2. Register the System: Register and subscribe your RHEL server system to Red Hat. See How to register and subscribe a system…​ for details. The following commands register your system and list available subscriptions. Choose an available RHEL server subscription, attach to its poolid, enable rhel-7-server-rpms and rhel-7-server-extras-rpms repositories, and upgrade to the latest software:

    # subscription-manager register --username=<user_name> --password=<password>
    # subscription-manager refresh
    # subscription-manager list --available
    # subscription-manager attach --pool=<pool_id>
    # subscription-manager repos --disable="*"
    # subscription-manager repos \
        --enable="rhel-7-server-rpms" \
        --enable="rhel-7-server-extras-rpms"
    # yum update -y
  3. Add Quay authentication: Set up authentication to Quay.io, so you can pull the Quay container, as described in Accessing Red Hat Quay without a CoreOS login.
  4. Setup Docker: Install, enable, and start the docker service as shown here (see Getting Docker in RHEL 7 for details):

    # yum install docker
    # systemctl enable docker
    # systemctl start docker
    # systemctl is-active docker
    active
  5. Install / Deploy a Database: Choose either MySQL or PostgreSQL as a database. This example shows how to deploy the MySQL database container (see the MySQL section of Using Red Hat Software Collections Container Images for details.) To configure the MySQL database, you can use the values shown here or change any of the following for storing MySQL data (/mnt/hostmysql) and setting database values:

    # mkdir -p /mnt/hostmysql
    # chmod 777 /mnt/hostmysql
    # export MYSQL_CONTAINER_NAME=mysql
    # export MYSQL_DATABASE=enterpriseregistrydb
    # export MYSQL_PASSWORD=JzxCTamgFBmHRhcGFtoPHFkrx1BH2vwQ
    # export MYSQL_USER=quayuser
    # export MYSQL_ROOT_PASSWORD=L36PrivxRB02bqOB9jtZtWiCcMsApOGn
    
    # docker run \
        --detach \
        --restart=always \
        --env MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} \
        --env MYSQL_USER=${MYSQL_USER} \
        --env MYSQL_PASSWORD=${MYSQL_PASSWORD} \
        --env MYSQL_DATABASE=${MYSQL_DATABASE} \
        --name ${MYSQL_CONTAINER_NAME} \
        --publish 3306:3306 \
        -v /mnt/hostmysql:/var/lib/mysql/data:Z \
        registry.access.redhat.com/rhscl/mysql-57-rhel7
    Note

    To generate passwords for MySQL user accounts, instead of setting them statically, run the following:

    # export MYSQL_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | sed 1q)

    # export MYSQL_ROOT_PASSWORD=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 32 | sed 1q)

  6. (optional) Check database connectivity: To check connectivity to the database, you can log in using the mysql command (from the mariadb package). Substitute the hostname (or IP address) of your MySQL service and your password. Type status to see information about your MySQL connection:

    # yum install -y mariadb
    # mysql -h 192.168.122.99 -u root --password=L36PrivxRB02bqOB9jtZtWiCcMsApOGn
    Welcome to the MariaDB monitor.  Commands end with ; or \g.
    Your MySQL connection id is 10184
    Server version: 5.7.21 MySQL Community Server (GPL)
    Copyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.
    Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
    MySQL [(none)]> status
    --------------
    mysql  Ver 15.1 Distrib 5.7.21-MariaDB, for Linux (x86_64) using readline 5.1
    Connection id:		10184
    Current database:
    Current user:		root@192.168.122.99
    ...
    Server version:		5.7.21 MySQL Community Server (GPL)
    Protocol version:	10
    Connection:		192.168.122.99 via TCP/IP
    ...
    MySQL [(none)]> \q
  7. Install / Deploy Redis: Run Redis as a container:

    # mkdir -p /mnt/hostredis
    # chmod 777 /mnt/hostredis
    # docker run -d --restart=always -p 6379:6379 \
        -v /mnt/hostredis:/var/lib/redis/data:Z \
        registry.access.redhat.com/rhscl/redis-32-rhel7
  8. Check redis connectivity: You can use the telnet command to test connectivity to the redis service. Type MONITOR (to begin monitoring the service) and QUIT to exit:

    # yum install telnet -y
    # telnet 192.168.122.99 6379
    Trying 192.168.122.99...
    Connected to 192.168.122.99.
    Escape character is '^]'.
    MONITOR
    +OK
    +1525703165.754099 [0 172.17.0.1:43848] "PING"
    QUIT
    +OK
    Connection closed by foreign host.
  9. Install / Deploy Quay: To run Red Hat Quay as a container, create two directories to store data on the host, then run Red Hat Quay as a container, as follows:

    Note

    Add -e DEBUGLOG=true to the docker run command line for the quay container to enable debug level logging.

    # mkdir -p /mnt/quay/config
    # #optional: if you don't choose to install an Object Store
    # mkdir -p /mnt/quay/storage
    # docker run --restart=always -p 443:443 -p 80:80 \
       --privileged=true \
       -v /mnt/quay/config:/conf/stack \
       -v /mnt/quay/storage:/datastorage \
       -d quay.io/coreos/quay:v2.9.5

    Wait several minutes for the Quay service to come up. Then proceed to Completing the Guided Setup.

Note

This can take several minutes, and when attempting to access the Guided Setup you might receive a proxy error. If you do please wait a while longer and try again.