ScanSkill

docker compose cp

The command docker compose cp is used to copy files/folders between a service container and the local filesystem;

$ docker compose cp [OPTIONS] SERVICE:SRC_PATH DEST_PATH|-
# OR,
$ docker compose cp [OPTIONS] SRC_PATH|- SERVICE:DEST_PATH

Here,

OPTIONS:

  • —all → Copy to all the containers of the service
  • —archive or -a → Copy all UID/GID information — archive mode
  • —index → index of the container(default is 1)
  • —follow-link or -L → Follow the symbol link in SRC_PATH