This article covers the basic steps for using the internal PodSpace registry as a private Docker registry.

You don’t have to follow this steps if you want to build and deploy Docker images within PodSpace. In that case, PodSpace pushes and pulls the images from the registry automatically.

If you want to access the PodSpace registry with the docker client from any external host (like your laptop for example), you should follow the steps described in this document.

Logging in to the Registry

First, you have to retrieve a PodSpace authorization token. For the steps described below, you will need to use the PodSpace command line client psc. You can download it from the documentations page.

To retrieve an authorization token and login with docker, follow these steps:

  1. Log In PodSpace. You will be asked for your PodSpace username (email address) and password:

    [user ~]$ psc login
  2. Get your access token:

    A token is a form of a password. Do not share your token.

    [user ~]$ psc whoami -t
  3. Log In PodSpace Docker Registry:

    [user ~]$ docker login -u <e-mail> -p <token_value> registry.podspace.io

Accessing the Registry

After you have Logged In the PodSpace Docker Registry, you are free to perform any docker pull or docker push command.

To provide a practical example, let’s pull a Wordpress Image from Docker Hub.

[user ~]$ docker pull docker.io/wordpress

Now that we have pulled the image, let’s make its purpose clear and tag it with something relevant.

[user ~]$ docker tag docker.io/wordpress registry.cloud.podspace.hu:443/podspace/wordpress

With the same set of Registry IP, Port and Token value used at the above Log In section, push the image to the PodSpace Docker registry.

[user ~]$ docker push registry.podspace.io/myproject/wordpress
The name of the PodSpace image repositories have a specific format. It is registry.podspace.io/project name/image stream name.

For more information about the internal registry refer to the OpenShift documentation.

A short note about deployments

Hurray! Now that you have pushed a Wordpress image to the PodSpace Docker registry, let’s deploy it.

There is a more comprehensive article about deploying applications on PodSpace.

[user ~]$ psc new-app wordpress WORDPRESS_DB_HOST=mysql:3306 WORDPRESS_DB_USER=wordpress WORDPRESS_DB_PASSWORD=wordpress WORDPRESS_DB_NAME=wordpress

Conclusion

Now you know how to Log In PodSpace, Push an Image to the PodSpace Docker Registry and Deploy it in no time, from the CLI.

For more information regarding deeper feature controls the CLI can provide use:

[user ~]$ psc --help