When Docker Is Faster Than the NAS

One morning, my backup tool failed for every GitHub repository it should mirror into my self-hosted Forgejo instance. The log contained ERR pkt-line 3: EOF git=push and Exiting with status=1. I first suspected the recently updated tool image. Plausible, quick to assume, and completely wrong.
The real cause was one layer below. Forgejo stores its repositories on the NAS, mounted into the container through NFS. My Docker host booted at 04:06:14, the Forgejo container started at 04:06:45, and the NFS mounts became active at 04:07:06, with the last one arriving at 04:07:16. Docker was faster than the NAS.
This order is dangerous because Docker resolves bind mounts when the container starts and creates missing source directories itself. If the mount point is only a local directory at that moment, Docker binds that empty directory. When NFS appears later, the host sees the real data, but the container remains attached to its local […]