Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker "cp" command in verbose mode

Tags:

docker

I use to copy directories from host to containers extensively before pushing them to a repository. Sometimes we may need to monitor the filenames getting pushed/copied during the Jenkins build.

How can i see what files are getting copied during a copy operation using "docker cp" ?

like image 477
vivekyad4v Avatar asked Oct 30 '22 03:10

vivekyad4v


1 Answers

There is nothing that docker provides but if your directories are empty then you can try and print what is there after the copy operation.

docker cp a b
docker exec container ls -alhR /your/path

Or you can print the same on the host side before copying. Because cp will only copy what you provide it. So either print it before or after copying. Before make more sense to me

like image 107
Tarun Lalwani Avatar answered Nov 15 '22 05:11

Tarun Lalwani