mmdii
mmdii

Reputation: 174

How to Read Container Registry images from 2 different repo on GitLab inside one server?

I have 2 different repositories and both make images inside their own container registry and I want to use both of them inside my server but as I know to pull images from the container registry I have to make a deploy token then use docker login -u <username> -p <deploy_token> registry.example.com to pull the image to use it. but how can I use 2 different Container Registry on separate repositories ? should I use docker login for both of them? I mean create a deploy token for both of them and then use them? is that even work?
If I want to be more specific I have 2 repositories containing backend and one containing frontend and both of them are dockerized in my pipeline I create images for both of them now I want to pull these images on my server but each of them has separate deploy token and docker login just accept one registry.

Upvotes: 0

Views: 1404

Answers (1)

sytech
sytech

Reputation: 40861

You can use docker login multiple times to authenticate with multiple registries. You are not limited to being logged into only a single registry. In other words, the effects of multiple docker login commands is cumulative.

You can also configure authentication for multiple registries using DOCKER_AUTH_CONFIG, which is a JSON array mapping registry URLs to authorization information.

See also:

Upvotes: 1

Related Questions