(九)10个镜像相关的API
最后更新于:2022-04-01 23:05:11
# Docker入门教程(九)10个镜像相关的API
> 【编者的话】DockerOne组织翻译了Flux7的Docker入门教程,本文是系列入门教程的第九篇,重点介绍了镜像相关的Docker Remote API。
在[Docker系列教程的上一篇文章](http://dockerone.com/article/109)中,我们讨论了Docker Remote API,并具体学习了有关容器的命令。在这篇文章中,我们将讨论有关镜像的命令。
#### 创建镜像
镜像可以通过以下两种方式来创建:
* 从Registry中提取
* 导入镜像
`POST /images/create`
截图示例:

#### 利用容器创建镜像
`POST /commit`
截图示例:

#### 获取镜像清单:
`GET /images/json`
截图示例:

#### Insert a File
导入指定的路径文件:
`POST /images/(name)/insert`
截图示例:

#### 删除镜像:
`DELETE /images/(name)`
截图示例:

#### 推送镜像到Registry
`POST /images/(name)/push`
截图示例:

#### Tag镜像
`POST /images/(name)/tag`
截图示例:

#### 搜索镜像:
`GET /images/search`
截图示例:

#### 查看镜像历史
`GET /images/(name)/history`
截图示例:

#### 构建镜像
`POST /build`
截图示例:

> 出处:http://dockone.io/article/110
> 原文链接:[10 Docker Remote API Commands for Images](http://blog.flux7.com/blogs/docker/docker-tutorial-series-part-9-10-docker-remote-api-commands-for-images)(翻译:[田浩浩](https://github.com/llitfkitfk) 审校:李颖杰)
';