如何使用 docker-compose 从多个私有注册表中提取? [英] How to pull from multiple private registries with docker-compose?

查看:23
本文介绍了如何使用 docker-compose 从多个私有注册表中提取?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试从两个不同的项目注册表(gitlab 容器注册表)中提取两个图像.所有这些都在 docker-compose.yml 文件中.

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

我如何配置我的 gitlab-ci.yml 或配置变量(无论什么都有效)以便正确提取我的图像而不会出现任何访问​​问题?

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

我找到了一个解决方案,使用 docker logindeploy token 来对我的项目注册表进行只读访问.问题是,如果我只有一个图像要拉:如何用gitlab ci构建、推送和拉取多个docker容器?

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?

推荐答案

在运行 docker-compose 之前,您可以多次使用 docker login,每个注册表一次,并且他们会堆叠.

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

这篇关于如何使用 docker-compose 从多个私有注册表中提取?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆