mirror of
https://github.com/yeasy/docker_practice.git
synced 2025-08-02 14:01:49 +00:00
Update local repo usage, add a batch script to upload local images
This commit is contained in:
@@ -111,7 +111,7 @@ $ curl http://192.168.7.26:5000/v1/search
|
||||
```
|
||||
这里可以看到`{"description": "", "name": "library/test"}`,表明镜像已经被成功上传了。
|
||||
|
||||
现在可以到另外一台机器去下载这个镜像
|
||||
现在可以到另外一台机器去下载这个镜像。
|
||||
```
|
||||
$ sudo docker pull 192.168.7.26:5000/test
|
||||
Pulling repository 192.168.7.26:5000/test
|
||||
@@ -125,3 +125,34 @@ $ sudo docker images
|
||||
REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE
|
||||
192.168.7.26:5000/test latest ba5877dc9bec 6 weeks ago 192.7 MB
|
||||
```
|
||||
|
||||
可以使用[这个脚本](https://github.com/yeasy/docker_practice/blob/master/_local/push_images.sh)批量上传本地的镜像到注册服务器中,默认是本地注册服务器`127.0.0.1:5000`。例如:
|
||||
```
|
||||
$ ./push_images.sh ubuntu:latest centos:centos7
|
||||
The registry server is 127.0.0.1
|
||||
Uploading ubuntu:latest...
|
||||
The push refers to a repository [127.0.0.1:5000/ubuntu] (len: 1)
|
||||
Sending image list
|
||||
Pushing repository 127.0.0.1:5000/ubuntu (1 tags)
|
||||
Image 511136ea3c5a already pushed, skipping
|
||||
Image bfb8b5a2ad34 already pushed, skipping
|
||||
Image c1f3bdbd8355 already pushed, skipping
|
||||
Image 897578f527ae already pushed, skipping
|
||||
Image 9387bcc9826e already pushed, skipping
|
||||
Image 809ed259f845 already pushed, skipping
|
||||
Image 96864a7d2df3 already pushed, skipping
|
||||
Pushing tag for rev [96864a7d2df3] on {http://127.0.0.1:5000/v1/repositories/ubuntu/tags/latest}
|
||||
Untagged: 127.0.0.1:5000/ubuntu:latest
|
||||
Done
|
||||
Uploading centos:centos7...
|
||||
The push refers to a repository [127.0.0.1:5000/centos] (len: 1)
|
||||
Sending image list
|
||||
Pushing repository 127.0.0.1:5000/centos (1 tags)
|
||||
Image 511136ea3c5a already pushed, skipping
|
||||
34e94e67e63a: Image successfully pushed
|
||||
70214e5d0a90: Image successfully pushed
|
||||
Pushing tag for rev [70214e5d0a90] on {http://127.0.0.1:5000/v1/repositories/centos/tags/centos7}
|
||||
Untagged: 127.0.0.1:5000/centos:centos7
|
||||
Done
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user