简体   繁体   English

如何使用 CI/CD 为 Gitlab 注册表推送基于 docker 组合的图像

[英]How can I push docker compose based images for Gitlab Registry Using CI/CD

I've linked Postgres DB & API images using docker-compose, its working in local, I've to push both image for gitlab registry Using CI/CD.我已经使用 docker-compose 链接了 Postgres DB 和 API 图像,它在本地工作,我必须使用 CI/CD 为 gitlab 注册表推送这两个图像。

enter image description here在此处输入图像描述

The gitlab docs cover how to build and push Docker images during CI quite well. gitlab 文档涵盖了如何在 CI 期间很好地构建和推送 Docker 图像

It is important to note/use the CI_REGISTRY_IMAGE variable.注意/使用CI_REGISTRY_IMAGE变量很重要。 If the image name you try to push is different from CI_REGISTRY_IMAGE , the push will fail.如果您尝试推送的图像名称与CI_REGISTRY_IMAGE不同,则推送将失败。 If you want to have multiple images, you either need to label them in the tag ( $CI_REGISTRY_IMAGE:db-$CI_COMMIT_REF_SLUG ) or create a separate repo and manage the images there.如果你想要多个图像,你要么需要在标签中 label 它们( $CI_REGISTRY_IMAGE:db-$CI_COMMIT_REF_SLUG ),要么创建一个单独的 repo 并在那里管理图像。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将 docker-compose 所需的多个图像推送到 GitLab CI 中的 GitLab 注册表? - How to push multiple images needed for docker-compose to GitLab registry in GitLab CI? 如何将环境变量传递给 docker 在 gitlab ci cd 中运行 - How to pass environment variable to docker run in gitlab ci cd 如何将 Docker 映像从 GitLab CI 注册表部署到 Amazon ECS? - How to deploy a Docker image from GitLab CI registry to Amazon ECS? 如何在 GitLab CI/CD 中集成 terraform - How to integrate terraform in GitLab CI/CD Gitlab CI/CD 使用 ssh / knownhosts 错误 - Gitlab CI/CD using ssh / knownhosts error 使用 Bash 和 cURL 通过 CI/CD 管道进入时生成 GitLab 合并请求 - Generate GitLab Merge Request when a push comes in via CI/CD Pipeline using Bash and cURL 上传 docker 图像 gitlab ci/cd Java Z38008DD81C2F4D7985ECF6E0CE8 - Upload docker image gitlab ci/cd Java Spring Jenkins CI/CD 部署到 AWS EKS 没有 Docker 注册表 - Jenkins CI/CD deployment to AWS EKS without Docker registry 如何通过 ssh 将文件复制到 ec2? (CI/CD 使用 gitlab CI) - How to copy a file to ec2 via ssh? (CI/CD using gitlab CI) 如何在 GCP 上使用 Cloud Build 在 CI/CD 脚本中包含 Container Registry 漏洞扫描 - How to inlcude Container Registry vulnerability scans in the CI/CD script using Cloud Build on GCP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM