How to rsync files into docker containers

Being very used to rsync project files into remote systems when working on them, I wanted to do the same with docker containers.

Of course there is docker cp, but it’s just not good enough. It copies over everything which takes time and bandwidth.

So this is what you want:

rsync -e "docker exec -i" --blocking-io -avz --delete --exclude=".git" . containerName:/projectPath/

You will need to have


, otherwise sync will stop at random point.

What’s your experience with it?

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *