简体   繁体   English

通过将 docker 映像从 gitlab 部署到 Heroku,证书已过期问题

[英]certificate has expired issue by deploying docker image to Heroku from gitlab

I've created an app on Heroku and I've been able to to deploy my Spring Boot dockerized application with heroku CLI from my machine.我已经在Heroku上创建了一个应用程序,并且我已经能够从我的机器上使用 heroku CLI 部署我的 Spring 启动 dockerized 应用程序。

However, when I try to perform the same actions from gitlab ci I've got an error on the last command.但是,当我尝试从gitlab ci执行相同的操作时,最后一个命令出现错误。 Everyhing before this command is working (the login to heroku, the push of the built image).此命令之前的所有操作(登录 heroku,推送构建的图像)。

Here's my .gitlab-ci.yml file:这是我的.gitlab-ci.yml文件:

 image: docker:latest stages: - build - deploy maven-build-application: stage: build image: maven:3-jdk-11 script: - mvn clean package -DskipTests artifacts: paths: - target/*.jar docker-build-and-deploy-application: stage: deploy image: rizkimufrizal/docker-node services: - docker:dind script: - npm install -g heroku - heroku container:login - heroku container:push web --app this-is-the-name-of-my-application # Here is the problem - heroku container:release web --app this-is-the-name-of-my-application

Output logs from my gitlab job:我的 gitlab 作业中的 Output 日志:

 latest: digest: sha256:62555048c6df008140c4720fc9fa0787caf2ef547a6c9d6e2608d3ba6c6e5dfa size: 953Your image has been successfully pushed. You can now release it with the 'container:release' command. $ heroku container:release web --app this-is-the-name-of-my-application ▸ CERT_HAS_EXPIRED: certificate has expired Cleaning up project directory and file based variables 00:01 ERROR: Job failed: exit code 1

I've made some research online but I can't find somehing on it, and I don't know what could I try?我在网上做了一些研究,但我找不到关于它的东西,我不知道我可以尝试什么?

Maybe because the command is made inside a docker, I have to install intermediate certifcates?可能是因为命令是在 docker 内部发出的,所以我必须安装中间证书?

Thank you for your help谢谢您的帮助

Antoine安托万

I think the node version which is used by rizkimufrizal/docker-node is very old with expired certificates.我认为rizkimufrizal/docker-node使用的节点版本非常旧,证书已过期。 Try a different / updated image with a more recent version.尝试使用更新版本的不同/更新图像。

Here's my updated final stage to deploy on heroku:这是我在 heroku 上部署的更新的最后阶段:

 docker-build-and-deploy-application: stage: deploy image: docker:latest services: - docker:dind before_script: - apk add nodejs npm script: - npm install -g heroku # Set the environemnet variable "HEROKU_API_KEY" # Get this token by running these commands: # #1 heroku login -i (write heroku username and password) # #2 heroku authorizations:create - heroku container:login # container:push web is going to build the docker image locally using the Dockerfile and push it to the repo - heroku container:push web --app this-is-the-name-of-my-application # container:release web is going to use the image pushed to deploy it - heroku container:release web --app this-is-the-name-of-my-application

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

相关问题 将 Docker 镜像部署到 Heroku - Deploying Docker Image to Heroku Docker 证书已过期或尚未生效 - Docker certificate has expired or is not yet valid 将 keycloak docker 镜像部署到 heroku - Deploying keycloak docker image to heroku Docker、GitLab 和将映像部署到 AWS EC2 - Docker, GitLab and deploying an image to AWS EC2 在Heroku容器注册表上使用Jenkins部署Docker镜像 - Deploying Docker Image with Jenkins on Heroku Container Registry 在 Heroku 上部署 Docker 图像时出现问题(反应应用程序) - Problem on deploying Docker image on Heroku (react app) Docker Swarm:来自守护进程的错误响应:验证根 CA 证书时出错:x509:证书已过期或尚未有效 - Docker Swarm: Error response from daemon: error while validating Root CA Certificate: x509: certificate has expired or is not yet valid Jenkins CI在Heroku上部署docker镜像 - Jenkins CI deploying docker image on Heroku 进行更改后,GitLab docker映像不会从gitlab.rb重新配置某些参数 - GitLab docker image does not reconfigure certain parameters from gitlab.rb after a change has been made 将Docker镜像从Gitlab的私有Docker注册表部署到Openshift - Deploying Docker images from Gitlab's private Docker registry to Openshift
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM