原csdn地址https://blog.csdn|

蜗牛使劲冲

园龄:7年6个月粉丝:3关注:10

docker使用加速器和推送到仓库

我这边使用的是阿里的镜像加速器

首先登陆[阿里云](http://dev.aliyun.com),然后搜索镜像,随便输入个hello,然后就看到
在这里插入图片描述
复制加速地址后到docker-setting- Daemon粘贴到Restory mirrors的框框里头=》apply
最后再docker info看下Restory mirrors的参数有变了么

创建镜像并上传

docker commit -a "wt" -m "this is nginx1.15" [容器id] nginx:v2

好了后去默认实例创建 镜像仓库-选择命名空间(可新建)-本地仓库-创建
好了后直接点开“管理”-复制登陆命令-commit-push 见下面代码

$ sudo docker login --username=10782@qq.com registry.cn-shanghai.aliyuncs.com
$ sudo docker tag [ImageId] registry.cn-shanghai.aliyuncs.com/lnmp_try/nginx_v1:[镜像版本号]
$ sudo docker push registry.cn-shanghai.aliyuncs.com/lnmp_try/nginx_v1:[镜像版本号]

就这样上去了。

还有种方法就是直接导出镜像文件,然后直接线下读就好了
docker save imageId -o D:/ddd.tar
docker load -i D:/ddd.tar

本文作者:蜗牛使劲冲

本文链接:https://www.cnblogs.com/warrenwt/p/18074609

版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。

posted @   蜗牛使劲冲  阅读(9)  评论(0编辑  收藏  举报  
评论
收藏
关注
推荐
深色
回顶
收起
点击右上角即可分享
微信分享提示