This is a bit of a guess but I suspect it is because docker is already using overlayfs and overlayfs is refusing to use upperdir
as another overlayfs.
I suspect this may be due to whiteout files:
In order to support rm and rmdir without changing the lower
filesystem, an overlay filesystem needs to record in the upper
filesystem that files have been removed. This is done using whiteouts
and opaque directories (non-directories are always opaque).
A whiteout is created as a character device with 0/0 device number.
When a whiteout is found in the upper level of a merged directory, any
matching name in the lower level is ignored, and the whiteout itself
is also hidden.
To delete a file that exists in a lowerdir, overlayfs will create a whiteout file and hides all whiteout files (device number 0,0
). This logically means that you cannot create a character device file with number 0,0
inside an overlayfs because that must be hidden by overlayfs itself.
If you were allowed to use an overlayfs as an upperdir
it wouldn't be able to create blackout files and therefore wouldn't be able to rm
or rmdir
any files from the lower layers. Because it can't create a character device file with number 0,0
on another overlayfs.