Multiple containers writing to a bind mount

axlrose

New Member
Jul 31, 2017
6
1
3
54
Are there any dangers of multiple containers bind mounting the same directory and writing to it? I assume the host handles the actually writing so things stay in sync and there aren't any collisions but I just wanted to check.
 
  • Like
Reactions: Pablo Alcaraz
A bind mount is a bind mount - all writes are handled by the host kernel. So there is no concurrency control, like with any other linux file system (not sure if I understand your question correctly).
 
A bind mount is a bind mount - all writes are handled by the host kernel. So there is no concurrency control, like with any other linux file system (not sure if I understand your question correctly).

So if 2 containers try to write to the same file, if container A opens the file and locks it, container B open file operation will fail. Is that correct?
 
yes (if the file system supports that kind of locks).

It will be ZFS. To echo what Pablo said, I was wondering if multiple containers could write to a bind mounted directory without issue.

You need a file server aka samba, nfs and so on - can provide a lock system or a concurrent writing from many clients.

This is not desirable for me as unprivileged containers can't mount samba or NFS shares without compromising security.
 
It will be ZFS. To echo what Pablo said, I was wondering if multiple containers could write to a bind mounted directory without issue.



This is not desirable for me as unprivileged containers can't mount samba or NFS shares without compromising security.

sshfs ?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!