0

In a docker container I want to mount a volume_from an other with a Linux Socket, the question sticks on the way it works in background.

AFAIK Linux sockets are memory only but once mounted on an other container does it work as so or somehow it uses IO?

thanks.

mortain
  • 3
  • 3

1 Answers1

1

AFAIK Linux sockets are memory only

I don't think this is true. The socket descriptor might be identified differently than a regular file. But the reading and writing should be the same as a file, so mounted volumes sharing that descriptor should work just as they do for a file. If both containers can read/write to that file descriptor then they should both be able to read/write when it is a socket descriptor as well.

Andy Shinn
  • 26,561
  • 8
  • 75
  • 93
  • Thanks Andy. I think I was misunderstood. Does descriptors use IO? I want to share php-fpm.sock with nginx (different containers) but I want the fastest option. Is it faster to use sockets or network in this particular case ? – mortain Jan 23 '16 at 22:53
  • I don't know. When _fastest_ is the main concern, I just test both and see which performs better for my application. There is no one _fastest_ or _best_ solution for every scenario. Honestly, I prefer the flexibility of HTTP or TCP sockets as it means my web and application (fpm) tiers can be on different hosts as long as they can communicate via IP. It is harder to share volumes between hosts. – Andy Shinn Jan 23 '16 at 23:03
  • ok, I will benchmark it and share here. :) thank you very much – mortain Jan 23 '16 at 23:11