指令 | 描述 |
---|---|
export | 导出容器文件系统到tar归档文件 |
Import | 导入容器文件系统tar归档文件创建镜像 |
save | 保存一个或多个镜像到一个tar归档文件 |
load | 家在镜像来自tar归档或标准输入 |
[root@docker nginx]# docker image --help
Usage: docker image COMMAND
Manage images
Commands:
build Build an image from a Dockerfile
history Show the history of an image
import Import the contents from a tarball to create a filesystem image
inspect Display detailed information on one or more images
load Load an image from a tar archive or STDIN
ls List images
prune Remove unused images
pull Pull an image or a repository from a registry
push Push an image or a repository to a registry
rm Remove one or more images
save Save one or more images to a tar archive (streamed to STDOUT by default)
tag Create a tag TARGET_IMAGE that refers to SOURCE_IMAGE
1.保存镜像
docker image save nginx:1.11 > nginx:1.11tar
2.导入镜像
docker load < nginx:1.11tar
3.列出镜像
docker images ls
4.查看一个镜像的历史分层
docker images history
5.查看详情
docker image inspect $镜像
6.拉取镜像
docker image pull nginx:1.1.1
7.推送镜像
docker image push
8.删除镜像
docker image rm nginx:1.12
9.打tag
docker tag nginx:1.11 nginx:v1
10.从容器导出文件为sky.tar
docker export 6ded32348de2 > sky.tar
11.从文件导入镜像为s1
docker image import sky.tar s1