docker 与host互传文件

docker 的cp命令可以从容器往外复制,也可以从本机复制的容器。

docker cp 文件路径 容器id:/容器目录

 

docker help cp Usage:    docker cp [OPTIONS] CONTAINER:PATH LOCALPATH|-     docker cp [OPTIONS] LOCALPATH|- CONTAINER:PATH Copy files/folders between a container and your host. Use '-' as the source to read a tar archive from stdin and extract it to a directory destination in a container. Use '-' as the destination to stream a tar archive of a container source to stdout.

posted @ 2017-03-13 17:34  风来风往风伤(TiAmo)  阅读(1586)  评论(0编辑  收藏  举报