查询镜像详情
此接口用于根据镜像仓库 ID 和镜像 ID 查询镜像详情。
接口描述
通信协议:HTTP
URL:GET /api/v1/registry/:registryId/image/:imageId
传参方式:path
请求参数
字段名 | 类型 | 是否必填 | 说明 |
---|---|---|---|
registryId | string | 是 | 仓库 ID |
imageId | string | 是 | 镜像 ID |
响应参数
字段名 | 类型 | 说明 |
---|---|---|
id | string | 镜像主键 |
name | string | 镜像名称 |
path | string | 镜像地址 |
os | string | 镜像系统,如 Linux、SylixOS |
arch | string | 镜像架构,如 arm64,amd64 |
createdTime | string | 镜像创建时间 |
size | int | 镜像大小,单位为 MB。小数点后保留两位,如果镜像小于 0.01 MB, 则返回 0.01 MB |
author | string | 镜像开发者 |
rawConfig | string | 镜像的 config 信息 |
config | DockerImageConfig | EcsImageConifg | 镜像的配置信息,由 rawConfig 字段解析而来。其中 DockerImageConfig 为 Linux 系统镜像配置信息;EcsImageConifg 为 SylixOS 系统镜像配置信息 |
ociVersion | string | OCI 版本。Docker 镜像为 v1;ECS 镜像为 1.0.0 |
hostname | string | 用户配置的容器的主机名称 |
tag | string | 镜像版本 |
pulled | boolean | 此字段仅在镜像为远端镜像时体现,表示镜像是否已拉取至本地。ture 表示已拉取至本地;false 表示未拉取至本地 |
请求示例
curl --location --request GET 'http://localhost:3001/api/v1/registry/local/image/bc33e9cc-68c7-4139-b319-cd60b01aea2c'
响应示例
{
"status": 200,
"message": "success",
"fieldErrors": null,
"data": {
"id": "bc33e9cc-68c7-4139-b319-cd60b01aea2c",
"name": "hello-world",
"os": "linux",
"size": 0.01,
"author": null,
"arch": "x86-64",
"rawConfig": "{\"architecture\":\"amd64\",\"config\":{\"Hostname\":\"\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/hello\"],\"ArgsEscaped\":true,\"Image\":\"sha256:a6d1aaad8ca65655449a26146699fe9d61240071f6992975be7e720f1cd42440\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":null},\"container\":\"8e2caa5a514bb6d8b4f2a2553e9067498d261a0fd83a96aeaaf303943dff6ff9\",\"container_config\":{\"Hostname\":\"8e2caa5a514b\",\"Domainname\":\"\",\"User\":\"\",\"AttachStdin\":false,\"AttachStdout\":false,\"AttachStderr\":false,\"Tty\":false,\"OpenStdin\":false,\"StdinOnce\":false,\"Env\":[\"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin\"],\"Cmd\":[\"/bin/sh\",\"-c\",\"#(nop) \",\"CMD [\\\"/hello\\\"]\"],\"ArgsEscaped\":true,\"Image\":\"sha256:a6d1aaad8ca65655449a26146699fe9d61240071f6992975be7e720f1cd42440\",\"Volumes\":null,\"WorkingDir\":\"\",\"Entrypoint\":null,\"OnBuild\":null,\"Labels\":{}},\"created\":\"2019-01-01T01:29:27.650294696Z\",\"docker_version\":\"18.06.1-ce\",\"history\":[{\"created\":\"2019-01-01T01:29:27.416803627Z\",\"created_by\":\"/bin/sh -c #(nop) COPY file:f77490f70ce51da25bd21bfc30cb5e1a24b2b65eb37d4af0c327ddc24f0986a6 in / \"},{\"created\":\"2019-01-01T01:29:27.650294696Z\",\"created_by\":\"/bin/sh -c #(nop) CMD [\\\"/hello\\\"]\",\"empty_layer\":true}],\"os\":\"linux\",\"rootfs\":{\"type\":\"layers\",\"diff_ids\":[\"sha256:af0b15c8625bb1938f1d7b17081031f649fd14e6b233688eea3c5483994a66a3\"]}}",
"ociVersion": "v1",
"createdTime": "2019-01-01T01:29:27.650294696Z",
"tag": "latest",
"description": "",
"pulled": true,
"delete": false,
"path": "local/hello-world@latest",
"config": {
"hostname": "",
"env": [
"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
],
"cmd": [
"/hello"
]
},
"hostname": null
}
}
错误码
具体请参见 错误码说明。