Docker镜像上传到阿里云的步骤详解
Docker  /  管理员 发布于 8年前   228
1 安装Docker运行环境
参考文档:https://docs.docker.com或者///article/94198.htm
2 注册阿里云账户
阿里云官方网站链接:https://dev.aliyun.com/search.html
例如:
账户:msjtest
密码:123456
3 登陆账户
4 管理Docker Hub镜像站点:配置Docker加速器
链接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/accelerator
5 创建镜像仓库的命名空间
例如:msj
链接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/namespace/index
6 创建镜像仓库
例如:image-test
链接:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.duOGn4#/imageList
7 操作指南
1)登录阿里云docker registry:
$ sudo dockerlogin --username=msjtest registry.cn-hangzhou.aliyuncs.com
注:登录registry的用户名是您的阿里云账号全名,密码是开通namespace时设置的密码。
2)从registry中拉取镜像:
$ sudo dockerpull registry.cn-hangzhou.aliyuncs.com/msj/image-test:[镜像版本号]
3)将镜像推送到registry:
$ sudo dockerlogin --username=mashujie registry.cn-hangzhou.aliyuncs.com$ sudo dockertag [ImageId] registry.cn-hangzhou.aliyuncs.com/msj/image-test:[镜像版本号]$ sudo dockerpush registry.cn-hangzhou.aliyuncs.com/msj/image-test:[镜像版本号]
其中[ImageId],[镜像版本号]请你根据自己的镜像信息进行填写。
8 终端执行脚本代码
#登陆命令$ docker login --username=mashujieregistry.cn-hangzhou.aliyuncs.com#查看主机镜像$ docker images#复制镜像ID并设置tag (或者tag repository:tag)$ docker tag 96eecaf1019a registry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01$ docker tag image01:01registry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01#上传镜像到阿里云镜像仓库$ docker pushregistry.cn-hangzhou.aliyuncs.com/msj/image-test:helloimage01
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。
test1 在
opencode + Oh-my-openagent,我的第一个免费的ai编程智能体管家:Sisyphus中评论 test..122 在
学历:一种延缓就业设计,生活需求下的权衡之选中评论 工作几年后,报名考研了,到现在还没认真学习备考,迷茫中。作为一名北漂互联网打工人..Zita 在
Google AI Studio升级全栈 vibe coding体验,可直接构建带登录和数据库的应用中评论 111222..123 在
Clash for Windows作者删库跑路了,github已404中评论 按理说只要你在国内,所有的流量进出都在监控范围内,不管你怎么隐藏也没用,想搞你分..原梓番博客 在
在Laravel框架中使用模型Model分表最简单的方法中评论 好久好久都没看友情链接申请了,今天刚看,已经添加。..
Copyright·© 2019 侯体宗版权所有·
粤ICP备20027696号
