I know this is an old post but wanted to post my experience with this specific warning and offer a possible fix to anyone that sees it in mailcow.
I hit this warning when running docker compose with mailcow:
WARN[0000] mount of type 'volume' should not define 'bind' option
In my case the stack still worked, but the warning was annoying. The root cause was :z / :Z being applied to a named volume mount. Those SELinux flags are meant for bind mounts (host paths), not for named volumes.
Example (this triggers the warning):
# named volume + :z (bad / causes warning)
- mysql-socket-vol-1:/var/run/mysqld/:z
Fix: remove :z/:Z on named volumes (keep them only on bind mounts like ./data/...:/...:z if you’re actually using SELinux):
# named volume without :z (good)
- mysql-socket-vol-1:/var/run/mysqld/
On systems without SELinux installed/enabled, removing these flags is safe (they do nothing anyway).
Quick way to fix just the mysql socket volume mounts:
cd /opt/mailcow-dockerized
cp -a docker-compose.yml docker-compose.yml.bak.$(date +%F-%H%M%S)
sed -i "s#mysql-socket-vol-1:/var/run/mysqld/:z#mysql-socket-vol-1:/var/run/mysqld/#g" docker-compose.yml
docker compose config >/dev/null
docker compose down
docker compose up -d
After this, docker compose config no longer prints the warning.
Hope this helps someone else.