Jenkins: 如何GCR使用Docker

本文介绍了如何使用Jenkins配合Google Cloud Registry(GCR)自动化构建并推送Docker镜像。首先安装了Docker Pipeline、Google Container Registry Auth和Google OAuth插件。接着配置Google Cloud的用户凭证,并创建服务账户密钥。将下载的JSON文件作为凭证导入Jenkins。最后,利用Docker Pipeline插件编写Jenkinsfile,以gcr前缀引用凭证,并采用gc-proyect-id/image-name格式指定镜像名称。
摘要由CSDN通过智能技术生成

I recently had to deal with the task of experimenting with automating the build and push of the Docker images, using Jenkins, to my company’s Google Cloud based container registry.

After hours of googling and reading plenty of articles here is the base solution I decided to apply.

The first thing I needed was make sure I had the following Jenkins’ plugins:

After that, I set up the Google Cloud credentials for the user we created to use with Jenkins. Then I created a service account key in the credentials page (API Manager > Credentials) in the Google Cloud console. It will download you a json file with the crendetials.

The next step I did was adding the credentials I just downloaded to our Jenkins container. I opened the

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

小涵

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值