阿里云镜像仓库说明:
将镜像推送到Registry
$ docker login --username=aliyun0398513152 rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com
$ docker tag [ImageId] rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com/rz-dt/k8s-springboot-demo:[镜像版本号]
$ docker push rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com/rz-dt/k8s-springboot-demo:[镜像版本号]
自己实战操作如下:
第一步生成本地镜像:
docker build -t rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com/rz-dt/k8s-springboot-demo:2022-12-01-17-34 .
第二步重命名本地镜像标签版本(docker images 查看镜像id0cd11ecdaf0f ):
docker tag 0cd11ecdaf0f rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com/rz-dt/k8s-springboot-demo:2022-12-01-17-34
第三步上传阿里云镜像仓库:
docker push rz-dt-image-server-registry.cn-shanghai.cr.aliyuncs.com/rz-dt/k8s-springboot-demo:2022-12-01-17-34
第四步发布k8s
kubectl apply -f k8s-springboot-demo.yaml