4

I've attempted to pull two images from two different projects registries (gitlab container registry). All that in a docker-compose.yml file.

How can I configure my gitlab-ci.yml or configure variables (whatever works) in order to pull my images properly without any access problems ?

I have found a solution using docker login with a deploy token to have read-only access to my project registry. The problem is that works if I had only one image to pull : How to build, push and pull multiple docker containers with gitlab ci?

obscure18
  • 169
  • 4
  • 8

2 Answers2

12

You can use docker login multiple times before running docker-compose, one for each registry, and they will stack.

CCH
  • 1,516
  • 1
  • 13
  • 24
0

thanks to @CCH, just complete by :
In my case I push in registry server with tag v3.0
and my docker-compose.yml try to pull on production server with tag v3
so I run :

docker tag registry.server.tdl/my-username/my-project/my-registry-name:v3.0 registry.server.tdl/my-username/my-project/my-registry-name:v3

to add tag used in my docker-compose.yml

bcag2
  • 1,988
  • 1
  • 17
  • 31