赞
踩
docker export命令是用来将docker容器中的文件系统导出为一个tar归档文件
docker export [参数] container
- [root@centos79 ~]# docker export --help
-
- Usage: docker export [OPTIONS] CONTAINER
-
- Export a container's filesystem as a tar archive
-
- Aliases:
- docker container export, docker export
-
- Options:
- -o, --output string Write to a file, instead of STDOUT
- [root@centos79 ~]#
命令:
docker export -o /root/ztj-running.tar ztj-running
- [root@centos79 ~]# docker ps -a | grep ztj-running
- 800d0759315f centos:centos7 "/bin/bash" 24 hours ago Up 26 minutes ztj-running
- [root@centos79 ~]# docker export -o /root/ztj-running.tar ztj-running
- [root@centos79 ~]# ls -l ztj-running.tar
- -rw------- 1 root root 211688960 11月 24 14:27 ztj-running.tar
- [root@centos79 ~]#
命令:
docker export -o /root/ztj-stopped.tar ztj-stopped
- [root@centos79 ~]# docker ps -a | grep ztj-stopped
- 5fffa9ab7380 centos:centos7 "/bin/bash" 24 hours ago Exited (137) 22 hours ago ztj-stopped
- [root@centos79 ~]# docker export -o /root/ztj-stopped.tar ztj-stopped
- [root@centos79 ~]# ls -l ztj-stopped.tar
- -rw------- 1 root root 211687936 11月 24 14:28 ztj-stopped.tar
- [root@centos79 ~]#
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。