docker container cp

Estimated reading time: 2 minutes

Description

Copy files/folders between a container and the local filesystem

Usage

docker container cp [OPTIONS] CONTAINER:SRC_PATH DEST_PATH|-
docker cp [OPTIONS] SRC_PATH|- CONTAINER:DEST_PATH

Options

Name, shorthandDefaultDescription
--archive , -aArchive mode (copy all uid/gid information)
--follow-link , -LAlways follow symbol link in SRC_PATH

Parent command

CommandDescription
docker containerManage containers
CommandDescription
docker container attachAttach local standard input, output, and error streams to a running container
docker container commitCreate a new image from a container’s changes
docker container cpCopy files/folders between a container and the local filesystem
docker container createCreate a new container
docker container diffInspect changes to files or directories on a container’s filesystem
docker container execRun a command in a running container
docker container exportExport a container’s filesystem as a tar archive
docker container inspectDisplay detailed information on one or more containers
docker container killKill one or more running containers
docker container logsFetch the logs of a container
docker container lsList containers
docker container pausePause all processes within one or more containers
docker container portList port mappings or a specific mapping for the container
docker container pruneRemove all stopped containers
docker container renameRename a container
docker container restartRestart one or more containers
docker container rmRemove one or more containers
docker container runRun a command in a new container
docker container startStart one or more stopped containers
docker container statsDisplay a live stream of container(s) resource usage statistics
docker container stopStop one or more running containers
docker container topDisplay the running processes of a container
docker container unpauseUnpause all processes within one or more containers
docker container updateUpdate configuration of one or more containers
docker container waitBlock until one or more containers stop, then print their exit codes

Extended description

Copy files/folders between a container and the local filesystem

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.