[英]How to download private image (locally) using docker-compose
This is my first time posting on here so apologies in advance if my question is quite broad or not structured well I have recently set-up my ci/cd pipeline and created my container registry successfully.这是我第一次在这里发帖,所以如果我的问题非常广泛或结构不好,请提前道歉,我最近设置了我的 ci/cd 管道并成功创建了我的容器注册表。 This is my gitlab-ci.yml file这是我的 gitlab-ci.yml 文件
gitlab-ci.yml file gitlab-ci.yml 文件
My current goal is to download the private image (Locally) created on GitLab using docker-compose.我目前的目标是使用 docker-compose 下载在 GitLab 上创建的私有图像(本地)。 I am kind of lost as to what this process looks like.我对这个过程的样子有点迷茫。 Any help will be much appreciated even if its referencing documentation.任何帮助将不胜感激,即使它的参考文档。
Thanks in advance!!提前致谢!!
In your docker-compose file you have to write the full image name.在您的 docker-compose 文件中,您必须写入完整的图像名称。 but first you have to login to that registry但首先您必须登录该注册表
docker login <<docker-registry>>
Enter your username and password for that docker-registry. docker login <<docker-registry>>
输入该 docker-registry 的用户名和密码。
Now if you run this command it should work docker pull <<docker-registry>>/yourImage
现在,如果您运行此命令,它应该可以工作docker pull <<docker-registry>>/yourImage
and this is docker-copmose example这是 docker-copmose 示例
version: '3'
services:
postgresql:
image: <<docker-rigstry>>/postgres:9.11
container_name: pg-docker
ports:
- "5400:5432"
environment:
- POSTGRES_USER=docker
- POSTGRES_PASSWORD=docker
volumes:
- ./postgres.conf:/etc/postgresql/postgresql.conf
command: postgres -c config_file=/etc/postgresql/postgresql.conf
restart: always
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.