0

我已经使用 docker 分发注册表(不是旧的 docker-registry)安装了一个私有 docker 存储库。我可以从另一台机器上查询 api 并查看我推送的图像,但我无法拉取它。

在机器 AI 上安装了一个 docker 分发容器:

sudo docker run --name=registry --restart=always -d -p 5000:5000 registry:2.0

我已经在机器 A 上创建并推送了我的图像。

$ sudo docker push 192.168.0.14:5000/sample-web-app
The push refers to a repository [192.168.0.14:5000/sample-web-app] (len: 1)
ab8ada80460c: Image already exists 
efe2cfd1b891: Image successfully pushed 
5a1f4c3d95f7: Image successfully pushed 
2f20cd8c82e9: Image successfully pushed 
6996ab83c944: Image successfully pushed 
f11858d1ad30: Image successfully pushed 
77820c2410c3: Image already exists 
8f4c453a5ccf: Image successfully pushed 
78214790fb9d: Image already exists 
5ab0027638b0: Image already exists 
78e0f5c7f8cc: Image successfully pushed 
75631aa15af4: Image successfully pushed 
8d2d7c43813c: Image successfully pushed 
389061f16e00: Image successfully pushed 
66e6b2b8450d: Image successfully pushed 
22ffb090109d: Image successfully pushed 
41f8e45936c6: Image successfully pushed 
fd15f8f632ed: Image successfully pushed 
e7e61dab0443: Image successfully pushed 
facfdaf41727: Image already exists 
07f8e8c5e660: Image already exists 
37bea4ee0c81: Image successfully pushed 
a82efea989f9: Image successfully pushed 
e9e06b06e14c: Image successfully pushed 
Digest: sha256:bcb172fe60efa418b8f0240346314a43a74f841882653a30e372c2d59a84dfe6

然后我删除了机器 A 上的本地映像。

$sudo docker rmi 192.168.0.14:5000/sample-web-app
Untagged: 192.168.0.14:5000/sample-web-app:latest
Deleted: ab8ada80460c055c637b77691f1dbe67e6377c29dfd06c820596f0247dd401f1
Deleted: efe2cfd1b891d94ab99b82c0d661b3af9d22a216379de596836bb365b618653a
Deleted: 5a1f4c3d95f72c3b50bd2e3df477cdb6e3e1793d8b96199572fba075a197a642

我在机器 A 上成功拉取了图像。

$ sudo docker pull 192.168.0.14:5000/sample-web-app
latest: Pulling from 192.168.0.14:5000/sample-web-app
5a1f4c3d95f7: Pull complete 
efe2cfd1b891: Pull complete 
ab8ada80460c: Already exists 
e9e06b06e14c: Already exists 
a82efea989f9: Already exists 
37bea4ee0c81: Already exists 
07f8e8c5e660: Already exists 
facfdaf41727: Already exists 
e7e61dab0443: Already exists 
fd15f8f632ed: Already exists 
41f8e45936c6: Already exists 
22ffb090109d: Already exists 
66e6b2b8450d: Already exists 
389061f16e00: Already exists 
8d2d7c43813c: Already exists 
75631aa15af4: Already exists 
78e0f5c7f8cc: Already exists 
5ab0027638b0: Already exists 
78214790fb9d: Already exists 
8f4c453a5ccf: Already exists 
77820c2410c3: Already exists 
f11858d1ad30: Already exists 
6996ab83c944: Already exists 
2f20cd8c82e9: Already exists 
Digest: sha256:bcb172fe60efa418b8f0240346314a43a74f841882653a30e372c2d59a84dfe6
Status: Downloaded newer image for 192.168.0.14:5000/sample-web-app:latest

我可以从机器 B 访问在机器 A 上的容器上运行的注册表,但我无法从中提取。

$ curl http://192.168.0.14:5000/v2/sample-web-app/tags/list
{"name":"sample-web-app","tags":["latest"]}
$ docker pull 192.168.0.14:5000/sample-web-app
Pulling repository 192.168.0.14:5000/sample-web-app
FATA[0000] Error: image sample-web-app:latest not found

$ docker version
Client version: 1.5.0
Client API version: 1.17
Go version (client): go1.3.3
Git commit (client): a8a31ef-dirty
OS/Arch (client): linux/amd64
Server version: 1.5.0
Server API version: 1.17
Go version (server): go1.3.3
Git commit (server): a8a31ef-dirty
4

0 回答 0