Docker Container Can't See Host Files? Anonymous Volume Overrides Bind Mount
Β· 3 min read
Encountered this issue while deploying a WordPress site for a client. Here's the root cause and solution.
TL;DRβ
The VOLUME declaration in an image's Dockerfile creates anonymous volumes with higher mount priority than docker-compose.yml bind mounts. Solution: Stop container β Delete anonymous volume β Restart.