使用阿里云搭建自己的镜像仓库
1、阿里云镜像仓库:https://dev.aliyun.com/search.html
点击管理控制台-》初次使用会提示开通,然后设置密码
xdclass.net123
2、使用阿里云私有镜像仓库
1)登录: docker login --username=794666918@qq.com registry.cn-shenzhen.aliyuncs.com
2) 推送本地镜像:
docker tag [ImageId] registry.cn-shenzhen.aliyuncs.com/xdclass/xdclass_images:[镜像版本号]
例子:
docker tag 2f415b0e9a6e registry.cn-shenzhen.aliyuncs.com/xdclass/xdclass_images:xd_rabbitmq-v1.0.2
docker push registry.cn-shenzhen.aliyuncs.com/xdclass/xdclass_images:xd_rabbitmq-v1.0.2
3)拉取镜像
线上服务器拉取镜像:
docker login --username=794666918@qq.com registry.cn-shenzhen.aliyuncs.com
docker pull registry.cn-shenzhen.aliyuncs.com/xdclass/xdclass_images:xd_rabbitmq-v1.0.2
启动容器:
docker run -d --name "xdclass_mq" -p 5672:5672 -p 15672:15672 2f415b0e9a6e