BananaDolphin
BananaDolphin

Reputation: 23

Sending files from one docker container to another

As the title states. I am looking to send a file from container A to container B. Both containers are running on separate volumes and are on the same network. Is this possible without temporarily storing the file in the host file system?

I have been reading around and found this solution, however it requires that the file I wish to send is temporarily stored in the host

https://medium.com/@gchudnov/copying-data-between-docker-containers-26890935da3f

Container A has its own volume to which a file is written to. I want to get Container A to send this file to a volume to which Container B is attached. Container B then reads this file.

Thanks

Upvotes: 0

Views: 1138

Answers (1)

aekiratli
aekiratli

Reputation: 538

If they are linux containers you can use scp

scp file [email protected]:/path

Upvotes: 2

Related Questions