Docker Registry

Helix TeamHub supports Docker image repositories. You can store and pull images via Docker engine version 1.6.0 or later.

Requirements

For the use of Docker repositories, SSL must be enabled. The certificate must be signed by a trusted Certificate Authority.

Storage Driver

Docker Registry uses the filesystem as the default storage driver, but it can be configured to utilize other drivers.

Driver Description
filesystem Local filesystem
s3 Amazon Simple Storage Service
azure Microsoft Azure Blob Storage
swift Openstack Swift
oss Aliyun OSS
gcs Google Cloud Storage

Configuration

To push or pull images, clients must be able to access storage backends (other than filesystem) directly.

Note

TeamHub can only back up Docker images when the storage driver is filesystem.

To change the storage driver:

  1. Edit hth.json and provide appropriate configuration:

    Default configuration:

    {
      "docker_registry": {
        "storage_driver": "filesystem",
        "storage_settings": {
          "rootdirectory": "/var/opt/hth/shared/storage/docker_registry/"
        }
      }
    }
    
    {
      "docker_registry": {
        "storage_driver": "s3",
        "storage_settings": {
          "accesskey": "s3-access-key",
          "secretkey": "s3-secret-key",
          "bucket": "s3-bucket",
          "region": "s3-region"
        }
      }
    }
    
    {
      "docker_registry": {
        "storage_driver": "azure",
        "storage_settings": {
          "accountname": "azure-storage-account-name",
          "accountkey": "azure-storage-account-key",
          "container": "azure-storage-container"
        }
      }
    }
    
    {
      "docker_registry": {
        "storage_driver": "swift",
        "storage_settings": {
          "authurl": "auth-token-url",
          "username": "openstack-username",
          "password": "openstack-password",
          "container": "swift-container",
          "region": "openstack-container-region"
        }
      }
    }
    
    {
      "docker_registry": {
        "storage_driver": "oss",
        "storage_settings": {
          "accesskeyid": "aliyun-oss-access-key-id",
          "accesskeysecret": "aliyun-oss-access-key-secret",
          "bucket": "aliyun-oss-bucket",
          "region": "aliyun-oss-region"
        }
      }
    }
    
    {
      "docker_registry": {
        "storage_driver": "gcs",
        "storage_settings": {
          "bucket": "gcs-storage-bucket"
        }
      }
    }
    

    For more details, see the Docker Registry docs.

  2. Reconfigure the environment:

    sudo hth-ctl reconfigure

Garbage Collection

Delete action provided by the TeamHub backend does not remove docker repositories permanently. Because Docker data is still persisted under the hood, you need to perform an additional step.

Combo

sudo hth-ctl docker-registry-garbage-collect

Cluster and HA

For cluster setups, the garbage collection process must respect other instances.

  1. Stop the docker registry service for all instances except the one from which the command is run:

    sudo hth-ctl stop docker_registry

  2. Run the command on the chosen instance:

    sudo hth-ctl docker-registry-garbage-collect

  3. Start the docker registry services for other instances:

    sudo hth-ctl start docker_registry