从远程计算机列出 Nexus 存储库中的 docker 镜像
我想列出 Nexus 上特定位置的所有 docker 镜像。这两种技术对我来说都是新的,这让我很难弄清楚该怎么做。
我在一台安装了 docker 的 Linux 机器上运行此命令 -
docker image ls --all xx.xx.xx.xx/myorg/nodelms*
其中 xx.xx.xx.xx 是 Nexus 的 IP 地址
输出中未列出任何内容,如下所示。
REPOSITORY TAG IMAGE ID CREATED SIZE
请有人指导我如何实现我所追求的目标。
I am wanting to list all the docker images in a particular location on Nexus. Both these technologies are new to me which is making it difficult to figure out what to do.
I am on a linux machine with docker installed & running this command -
docker image ls --all xx.xx.xx.xx/myorg/nodelms*
where xx.xx.xx.xx is the IP address of Nexus
Nothing is listed in the output as shown below.
REPOSITORY TAG IMAGE ID CREATED SIZE
Please can someone guide me on how to achieve what I am after.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
docker image ls
仅与本地 docker 引擎交互,告诉您之前已拉取的镜像。要查询远程注册表,您需要使用注册表 API。该 API 由 OCI distribution-spec。您可以运行一些curl命令来实现这一点,尽管身份验证通常是复杂的部分。有各种项目可以访问此 API,包括 go-containerregistry 的 Crane(由 Google 提供)、skopeo(由 RedHat 提供)和 regclient(由我)。使用 regclient 的 regctl 的示例如下所示:The
docker image ls
only interacts with the local docker engine, telling you about images that have been previously pulled. To query a remote registry, you'll want to hit the registry API. That API is documented by the OCI distribution-spec. You could run some curl commands to implement this, though auth is typically the complicated part. Various projects exist to access this API, including go-containerregistry's crane (by Google), skopeo (by RedHat), and regclient (by me). An example of using regclient'sregctl
for this looks like:然后检查特定存储库的图像列表:
v1/components?repository=repository_name
And then check list of images of specific repo:
v1/components?repository=repository_name