How to configure a Docker Registry with HCS.

Docker Registry

A guide on how to configure a Docker Registry with HCS.

You can easily push your built docker images to any docker registries with HCS.

You just need to fill the Docker Registry fields in your service General configurations.

Configuration

Docker Image

If this field is set, HCS will automatically push your built docker image to the specified docker registry.

If the image is empty, HCS won’t push your built image.

Docker Image Tag

If this field is set, HCS will automatically push your built docker image with the specified tag to the specified docker registry + the git commit sha tag.

If the tag is empty, HCS only push your built image with the git commit sha tag.

Docker Credentials

Docker credentials (from v4.0.0-beta.88) are used to authenticate with Docker registries to pull/push images.

If you want to authenticate HCS with a Docker Registry:

  1. Login to your server : Login on the server through SSH with the same user that configured for your server.

  2. Authenticate to Docker Registry:

    Login to the Docker Registry, normally execute docker login command.

    You will be prompted to enter your Docker registry username and password/token - this can be varied depending on the Docker registry you are using.

Once you logged in, HCS will automatically detect your credentials and use them.

Swarm Mode

If you are deploying to a Swarm cluster, you need to make sure that your Docker Registry is accessible from all nodes in the cluster, workers and managers.

Host your own registry

You can easily host your own registry, however, it will consume a lot of storages as by default it stores images locally on the server.

More info on how to set other storage drivers can be found in the official documentation.

You can find the one-click service in HCS.

Setup

You need to generate an user / password for the registry.

You can generate one with the htpasswd command:

Then go to Storages menu, and in the /auth/registry.password file, simply add the generated user / password. One line per user.

Last updated