Private Registry inside PaaS
Private Registry inside PaaS
The registry can be deployed as a custom container inside the platform. After configuration, Docker images can be pushed from a local machine and later deployed to platform environments from the private repository.
Deploy Private Registry
The official registry image is available through Docker Hub and can be deployed as a custom container in the platform.
1Create a new environment
Sign in to the platform and click New Environment in the top toolbar.
2Select the registry image
Open the Docker tab in the topology wizard, click Select Image, search for the registry image, and add it to the environment.
3Configure the environment
Set the disk limit, environment name, region, resource limits, and other required options. Click Create and wait while the environment is provisioned.
Configure External Access
The registry listens on private port 5000. Create an endpoint to expose this port externally.
4Add an endpoint
Open the environment Settings, navigate to Endpoints, and add a new endpoint. Set the Private Port to 5000.
The created endpoint becomes the registry entry point used in Docker commands.
Add an Image to the Registry
The following example pulls an existing image from Docker Hub, tags it for the private registry, and pushes it to the new repository. A locally created image can also be used.
5Check Docker installation
Install Docker CE on the local machine when it is not already available. Confirm the Docker daemon version using:
docker -v
The source guide requires Docker daemon version 1.6.0 or newer.
6Pull and tag the image
Pull the required image and tag it with the registry entry point and repository name:
docker pull {image} && docker tag {image} {entry_point}/{repository}
{image}— the Docker image to pull and tag, for examplejelastic/haproxy.{entry_point}— the endpoint or public IP assigned to the private registry.{repository}— the repository name inside the private registry, for examplehaproxy.
Secure Registry Communication
Remote private-registry communication should be protected with TLS. Install a server key and domain certificate issued by a recognised certificate authority.
A self-signed certificate can also be used, but each Docker daemon that connects to the registry must be configured to trust it.
For a temporary insecure-registry setup, add the following option to the local Docker daemon configuration, such as /etc/default/docker:
DOCKER_OPTS="--insecure-registry {entry_point}"
Push the Image
Restart the local Docker daemon and push the tagged image to the registry:
sudo service docker restart
docker push {entry_point}/{repository}
Upload time depends on the image size and the available Internet connection speed. After the push is complete, the image can be deployed in the platform as a custom container from the private registry.
