Jenkins+K8s实现持续集成(一)

镜像仓库的搭建

复制代码
docker run -d \
    --restart=always \
    --name registry \
    -p 5000:5000 \
    -v /root/devops/registry/data:/var/lib/registry \
    registry

安装完之后,执行下面命令可以看到镜像仓库已经安装成功

复制代码
docker ps

然后在浏览器上输入下面地址进行访问

http://ip:5000/v2/_catalog

再配置vi /etc/docker/daemon.json

复制代码
{
"insecure-registries" : [ "http://ip:5000" ] #ip改成自己的
}  

先在另外一台机器上使用docker images查看docker镜像,里面有一个hello/gocd-agent-hello的镜像

然后开始打包上传

复制代码
docker tag hello/gocd-agent-hello ip:5000/gocd-agent-hello

然后在这台机器上也vi /etc/docker/daemon.json配置

复制代码
{
  "insecure-registries": ["ip:8081","ip:5051","ip:5052","ip:5000","http://ip:5000"]
}

开始推送:

复制代码
docker push ip:5000/gocd-agent-hello
相关推荐
匀泪19 小时前
云原生(Kubernetes service微服务)
微服务·云原生·kubernetes
木雷坞1 天前
2026年4月实测:K8s containerd 镜像拉取全方案汇总
运维·容器·kubernetes
Mark108591 天前
Hexo + GitHub Pages + GitHub Actions:源码私有、站点公开的 CI/CD 教程
ci/cd·github
冬奇Lab2 天前
AI Native 时代的 CI/CD:从“手工流水线”到“智能驾驶舱”的范式演进
人工智能·ci/cd
没有口袋啦2 天前
《基于 GitOps 理念的企业级自动化 CI/CD 流水线》
阿里云·ci/cd·云原生·自动化·k8s
前端不太难2 天前
鸿蒙游戏的 CI/CD 方案
游戏·ci/cd·harmonyos
XmasWu12253 天前
【Hermes Agent集成】与CI/CD工作流结合
人工智能·ci/cd
小义_3 天前
【Kubernetes】(五) pod2
linux·云原生·容器·kubernetes
雨奔3 天前
Kubernetes 对象标识详解:Name、UID、Label
云原生·容器·kubernetes