[英]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.