My setup: Virtualbox with a Windows Host and Ubuntu Server guest. Ubuntu is now 21.04 but the issue existed before upgrade from 20.04. And on the Ubuntu Server I run Docker.
The issue: The shares from virtualbox, which I think are mounted by the Vbox guest addons are not mounted until after Docker starts. The containers start OK as their config is on /home which is a local drive, however they have data on a share. Because Docker starts before the shares are mounted the containers bind to the mountpoint as a directory rather than a mount and they can write to the disk there filling up the root filesystem with invisible files.
I hadn't made any changes recently other than keeping up with Ubuntu updates but I feel like I might have put a sleep somewhere in the past to get around this. I could look to do this again but it seems rather inelegant and I wondered if there might be a better way through systemd or otherwise.
I've tried a number or systemd directives without any luck. RequiresMountsFor and ConditionPathIsMountPoint were the two that I thought might work. I also tried to tell the docker service to start after the vbox guest service but this didn't work either.
Any suggestions?