从远程计算机列出 Nexus 存储库中的 docker 镜像

发布于 2025-01-09 08:41:22 字数 341 浏览 0 评论 0原文

我想列出 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

薄荷→糖丶微凉 2025-01-16 08:41:22

docker image ls 仅与本地 docker 引擎交互,告诉您之前已拉取的镜像。要查询远程注册表,您需要使用注册表 API。该 API 由 OCI distribution-spec。您可以运行一些curl命令来实现这一点,尽管身份验证通常是复杂的部分。有各种项目可以访问此 API,包括 go-containerregistry 的 Crane(由 Google 提供)、skopeo(由 RedHat 提供)和 regclient(由我)。使用 regclient 的 regctl 的示例如下所示:

$ regctl tag ls localhost:5000/library/debian
10
10-slim
10.3
10.3-slim
10.4
10.4-slim
10.5
10.5-slim
10.6
10.6-slim
10.7
10.8
6
7
8
9
buster-slim
latest

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's regctl for this looks like:

$ regctl tag ls localhost:5000/library/debian
10
10-slim
10.3
10.3-slim
10.4
10.4-slim
10.5
10.5-slim
10.6
10.6-slim
10.7
10.8
6
7
8
9
buster-slim
latest
半仙 2025-01-16 08:41:22
curl -u user_name:password -X GET(optional here, as GET method was chosen by default) 'ip_nexus_repo:port/service/rest/v1/repositories'

然后检查特定存储库的图像列表:v1/components?repository=repository_name

curl -u user_name:password -X GET(optional here, as GET method was chosen by default) 'ip_nexus_repo:port/service/rest/v1/repositories'

And then check list of images of specific repo: v1/components?repository=repository_name

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文