Registry
Learn how to use a private registry for your images
Creating a private repository for your image
We provide a private image registry you can push images to with each service. To make use of it you can start by creating a service and configuring it:
Note that we are leaving the Image empty, this will auto-populate the service with the provisioned registry. We are also setting Replicas
to 0 to avoid starting the service and incurring costs before we have pushed the image.
Now you can click on Create:
Now you can click on the newly created service:
And copy the image:
Configuring docker to use Nhost’s registry
The CLI can configure docker automatically to be able to push and pull images from the docker registry. To do so you need to run the following command:
After you have configured the credentials helper with the command above docker should be able to interact with your images normally:
nhost login
.Updating the image in the service configuration
After you have pushed your image you can click on your service again and update the configuration:
Notice we added the tag :123
to the image that was already pre-populated and that we increased replicas to 1
to unpause the service. Don’t forget to copy the URL where we are exposing the service. Now you can click on update:
Wait a few seconds until the project is done updating the new service and visit the URL we copied before:
Using your own private registry
If you are publishing your images in your own private registry you can add pull credentials to your Run configuration so the image can be pulled successfully. To do so follow the next steps:
- Figure out the credentials you need. This might depend on your registry. For instructions on various registries see the next section.
- The credentials will be similar to:
- Create a secret under Settings -> Secrets with the contents of the auth section. For instance:
Pay attention that only the object inside “auths” is to be added.
- Configure the
pullCredentials
in your run configuration.
Pulling your image should work now.
Docker Hub Credentials
To create a credential that allows you to pull private images from Docker hub follow the next steps:
- Login to https://hub.docker.com with a user that can pull the image you want.
- Head to “Account Settings” -> “Personal access tokens”
- Create a new token with “Read Only” access permissions
- Copy the token you got
Your credentials will be: