windows下载docker镜像

环境:
OS:windows10
Python:3.10.99

 

1.下载文件docker_pull.py
https://github.com/NotGlop/docker-drag/tree/master

 

2.文件放到如下目录
D:\docker_pull

 

3.下载测试
cmd命令模式操作
c:\>d:
d:\>cd docker_pull
D:\docker_pull>python docker_pull.py registry.cn-shenzhen.aliyuncs.com/gondor/busybox:1.32

 

D:\docker_pull>python docker_pull.py milvusdb/milvus:v2.4.15
Creating image structure in: tmp_milvus_v2.4.15
7646c8da3324: Pull complete [29533754]
de20bce77bfa: Pull complete [37173843]
390923469996: Pull complete [10295]
75f8a77b55ac: Pull complete [88202080]
4ba680cd8483: Pull complete [29967]
6210f175eb4d: Pull complete [408368494]                                      ]
Docker image pulled: milvusdb_milvus.tar

 

 

下载的镜像文件会存放在D:\docker_pull目录

 

说明:

该工具很多的镜像下载不了,仅支持v2模式,另一个办法就是在windows下安装docker destop

 

#################上传windows下载的docker镜像到阿里云私人仓库########################

 

1.上传windows下载的镜像到安装有docker的linux服务器(我这里windows没有安装docker)
[root@master1 soft]# ls
milvusdb_milvus.tar

 

2.登录私人仓库
[root@master soft]# docker login --username=slnngk@163.com registry.cn-shenzhen.aliyuncs.com ##登录阿里云个人仓库,需要输入登录密码
[root@master1 soft]# docker load -i milvusdb_milvus.tar
[root@master1 soft]# docker load -i milvusdb_milvus.tar
0b9c994b0484: Loading layer [==================================================>] 80.41MB/80.41MB
f8384d0a67f5: Loading layer [==================================================>] 118.2MB/118.2MB
b897e33c19c4: Loading layer [==================================================>] 28.16kB/28.16kB
7ec461d64091: Loading layer [==================================================>] 216.2MB/216.2MB
a91d0c4b5468: Loading layer [==================================================>] 122.9kB/122.9kB
123cdb33a039: Loading layer [==================================================>] 1.191GB/1.191GB
Loaded image: milvusdb/milvus:v2.4.15

 

查看镜像
[root@master1 soft]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
milvusdb/milvus v2.4.15 278de20b4f8d 9 days ago 1.6GB

 

镜像打标签并上传
[root@master soft]# docker tag 278de20b4f8d registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15
[root@master soft]# docker push registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15

 

 

然后在服务器上下载阿里云私人镜像
docker pull registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15

[root@host135 milvus]# docker pull registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15

v2.4.15: Pulling from hxlk8s/milvus
2ec76a50fe7c: Pull complete
1843205aaf00: Pull complete
748474a198ce: Pull complete
75f8a77b55ac: Pull complete
4ba680cd8483: Pull complete
6210f175eb4d: Pull complete
Digest: sha256:de92ccd363aa79e4c225ff78aee29422e29f643530f5563c6617bec15d22ba38
Status: Downloaded newer image for registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15
registry.cn-shenzhen.aliyuncs.com/hxlk8s/milvus:v2.4.15

 

打上标签,与docker-compose.yml配置文件中定义的一致
[root@host135 2.4.6]# docker tag 278de20b4f8d milvusdb/milvus:v2.4.15

 

posted @ 2024-08-28 13:34  slnngk  阅读(147)  评论(0编辑  收藏  举报