← 返回命令列表

Linux command

docker-container-cp 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Copy file from container to host

docker container cp [container]:[/path/in/container] [/local/path]

Copy file from host to container

docker container cp [/local/file] [container]:[/path/in/container]

Copy directory

docker container cp [container]:[/src/dir] [/dest/dir]

说明

docker container cp copies files between containers and the local filesystem. Works with running or stopped containers.

参数

-a, --archive
Archive mode (preserve permissions).
-L, --follow-link
Follow symbolic links.

FAQ

What is the docker-container-cp command used for?

docker container cp copies files between containers and the local filesystem. Works with running or stopped containers.

How do I run a basic docker-container-cp example?

Run `docker container cp [container]:[/path/in/container] [/local/path]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -a, --archive do in docker-container-cp?

Archive mode (preserve permissions).