在Gitlab中使用Harbor

提示,如果是直接在docker中运行的gitlab-runner需要在docker配置中将域名添加信任。如果是在k8s中运行的gitlab-runner,需要在ci文件中添加信任配置

在.gitlab-ci.yml文件中使用

构建镜像过程中添加如下代码可推送镜像至仓库

    - docker build -t $PROJECT .
    - docker login -u 'robot$gitlab' -p 'SeQh123vpuJo3iHz' harbor.thefunc.com
    - docker tag chatgptwebapi:latest harbor.thefunc.com/chatgpt/chatgptwebapi:latest
    - docker push harbor.thefunc.com/chatgpt/chatgptwebapi:latest
    - docker logout harbor.thefunc.com

Hits: 4369

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据