0

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

  • Usually you’d do this with something like an HTTP POST from one container to another’s HTTP endpoint. Setups specifically oriented around “sharing files” tend to be trickier to set up and don’t scale well if you move to a cluster setup like Kubernetes. – David Maze Mar 18 '20 at 19:13
  • @DavidMaze thank you. This is just a little application I am making and have no intention of scaling it up so this should work. Thank you – BananaDolphin Mar 18 '20 at 20:10

1 Answers1

2

If they are linux containers you can use scp

scp file root@172.17.x.x:/path
aekiratli
  • 518
  • 7
  • 18