Dan, Dusty, Vivek:
So far nobody has defined (technically) the exact problem with overlayfs and how it affects applications which want to write data inside the container.
Note that just saying "don't use Overlay for persistent data" really isn't good enough. Apps in containers frequently write data to places users aren't aware of, such as writing port information to /var/run. While this data may not be important to the user, the app will fail if it errors out.
Pushing a change which will cause 30% of a user's containers to start failing for reasons which are opaque to them is not something we should do lightly.
On 12/15/2016 12:18 PM, Josh Berkus wrote:
Dan, Dusty, Vivek:
So far nobody has defined (technically) the exact problem with overlayfs and how it affects applications which want to write data inside the container.
Note that just saying "don't use Overlay for persistent data" really isn't good enough. Apps in containers frequently write data to places users aren't aware of, such as writing port information to /var/run. While this data may not be important to the user, the app will fail if it errors out.
Pushing a change which will cause 30% of a user's containers to start failing for reasons which are opaque to them is not something we should do lightly.
Josh. More likely this will cause .0001% of users to fail. But it is not a Posix compliant database, so their could be issues.
Only other issues I know of now are the handling of "special" files things like sock_files, character devices etc. But these should almost always be on tmpfs places like /dev and /run.
The Docker docs also has a breakdown of incompatibilities:
https://docs.docker.com/engine/userguide/storagedriver/overlayfs-driver/#/ov...
Notably, there's the open(2) issue that has already been mentioned. The second issue is that rename(2) can fail if trying to move a dir across the lower and upper dirs:
$ mkdir lower upper work merged $ mkdir lower/dir $ sudo mount -t overlay overlay \ -olowerdir=$PWD/lower,upperdir=$PWD/upper,workdir=$PWD/work \ merged $ python -c 'import os; os.rename("merged/dir", "merged/dir2")' Traceback (most recent call last): File "<string>", line 1, in <module> OSError: [Errno 18] Invalid cross-device link
So you have to watch for EXDEV and fall back on copying.