I have two containers A and B which needs to talk via unix domain socket created by A in /var/run/notif.sock.
I can't use named volume as sharing /var/run between containers is risky as it contains container's runtime data.
Bind mount requires the host to already have a file with same name.
Problem with bind mount is if I create a host file with same name as the socket file, and use bind mount like this: --v /var/run/notif.sock : /var/run/notif.sock , it would create a plain file /var/run/notif.sock automatically by docker inside container A and when the actual process inside container A tries to open the socket, socket file creation would fail inside the container with error "address already in use" as a file with same name is already present.
Is there any other way to go about this?