- export
- import
export
- 用法
Usage: docker export [OPTIONS] CONTAINERExport a filesystem as a tar archive (streamed to STDOUT by default)--help=false Print usage-o, --output= Write to a file, instead of STDOUT
- 例子
$ sudo docker export b448f729a0b0 > centos.tar
- 总结
把容器系统文件打包并导出来,方便分发给其他场景使用。
import
- 用法
Usage: docker import [OPTIONS] URL|- [REPOSITORY[:TAG]]Create an empty filesystem image and import the contents of thetarball (.tar, .tar.gz, .tgz, .bzip, .tar.xz, .txz) into it, thenoptionally tag it.-c, --change=[] Apply Dockerfile instruction to the created image--help=false Print usage
- 例子
从网络上导入:
$ sudo docker import http://example.com/exampleimage.tgz
从本地文件导入:
通过标准输入和pipe导入到docker.
$ cat exampleimage.tgz | sudo docker import - exampleimagelocal:new
从本地目录导入:
$ sudo tar -c . | docker import - exampleimagedir
带配置信息从本地目录导入:
$ sudo tar -c . | docker import --change "ENV DEBUG true" - exampleimagedir
- 总结
暂无
