简体   繁体   English

Gitlab CI/CD 与 JHipster 和 Docker 注册表

[英]Gitlab CI/CD with JHipster and Docker registry

I made a JHipster application, and I want to add CI/CD with a private Gitlab runner to deploy on a private Docker registry.我制作了一个 JHipster 应用程序,我想添加带有私有 Gitlab 运行器的 CI/CD,以部署在私有 Docker 注册表上。 I get this failure:我得到了这个失败:

[ERROR] Failed to execute goal com.google.cloud.tools:jib-maven-plugin:2.0.0:build (default-cli) on project powerfront: Invalid image reference :master-35274d52bd71e28f08a0428832001cc67e9c446d, perhaps you should check that the reference is formatted correctly according to https://docs.docker.com/engine/reference/commandline/tag/#extended-description
 [ERROR] For example, slash-separated name components cannot have uppercase letters: Invalid image reference: :master-35274d52bd71e28f08a0428832001cc67e9c446d

This is the relevant part of my.gitlab-ci.yml这是 my.gitlab-ci.yml 的相关部分

# Uncomment the following line to use gitlabs container registry. You need to adapt the REGISTRY_URL in case you are not using gitlab.com
docker-push:
    stage: release
    variables:
        REGISTRY_URL: 10.1.10.58
        IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG-$CI_COMMIT_SHA
    dependencies:
        - maven-package
    script:
        - ./mvnw -ntp compile jib:build -Pprod -Djib.to.image=$IMAGE_TAG -Djib.to.auth.username=gitlab-ci-token  -Djib.to.auth.password=$CI_BUILD_TOKEN -Dmaven.repo.local=$MAVEN_USER_HOME

EDIT: There was an unconfigured variable.编辑:有一个未配置的变量。 Now I get现在我明白了

 [ERROR] I/O error for image [10.1.10.58:5000/powerfront]:
 [ERROR]     javax.net.ssl.SSLException
 [ERROR]     Unrecognized SSL message, plaintext connection?

How do I tell the runner to accept unsecure (plaintext) connections?我如何告诉跑步者接受不安全的(明文)连接?

To publish to a private (or another public) registry, your image name must start by the host name of the registry: private.registry.io/group/image:version so that Docker daemon knows that it doesn't push to Docker Hub (which the default) but to private.registry.io要发布到私有(或其他公共)注册表,您的映像名称必须以注册表的主机名开头: private.registry.io/group/image:version :version 以便 Docker 守护进程知道它不会推送到 Docker Hub (默认)但到private.registry.io

Also U can use Kaniko to publish your image, as it doesn't require dind or privileged mode on Docker daemon.您也可以使用Kaniko发布您的图像,因为它不需要 Docker 守护程序上的 dind 或特权模式。

I'm not sure that is a Gitlab CI problem.我不确定这是 Gitlab CI 问题。 but with JHipster.但与 JHipster。
What is the value for CI_REGISTRY_IMAGE ? CI_REGISTRY_IMAGE的值是多少? We don't see the value in the error message.我们看不到错误消息中的值。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM