Bound mount not working

OS: Fedora Linux 36 (KDE) x86_64
Kernel: 6.2.15-100.fc36.x86_64
Docker version: 24.0.2, build cb74dfc
Docker Compose version: v2.18.1

I’m having an issue where the bound mount on a docker container just doesn’t work. None of the files in the host show up in the container and while everyone else on the team can easily build their containers I’m the only one left hanging.

A docker inspect shows the mount correctly:

        "Mounts": [
                "Type": "bind",
                "Source": "/var/www/html/ai-solutions/auditoria",
                "Destination": "/var/www/html",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"

and yet, abolsutely no files show on the container.

The docker compose up --build -d command runs without any errors - images and volumes are created, I can access the containers shells, etc… - but still, no files in the mount and I honestly don’t know what else I can do.

Can anyone please help?


Just to be sure: you are aware that volumes are runtime configuration, and that they are not present during build time.

Since you are on a rhel based system, I can imagine that selinux might cause perfectly configured binds to now work as expected. With docker run you would use -v /var/www/html/ai-solutions/auditoria:/var/www/html:Z to modify the selinux labels (see here). It works the same way for the short volume syntax, but I have no idea how it needs to be configured for the long syntax.

Hi, thank you for the quick reply. SELinux isn’t running, I have it disabled:

> getenforce 

No idea then. If the source path on the host and the container path are correct, it should be at least listable inside the container, regardless whether the owner/group ip of the folders and files align with the user inside the container.

Exactly. And the paths are absolutely correct… I’ve double checked them a few times.