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.
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.
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.
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.
If I do docker exec and ls -l /spark I get an empty directory, but surprisingly if I do ls -l /spark_test I get the 3.5.0 folder and the libexec folder inside it, but none of the other files that both of those directories contain on the host.
Well, check user:group for your folders on host. Are they the same or different? Did you start the image with a dedicated used? What’s the default user of your image/Dockerfile?
When you don’t have permission to access a folder, you can’t mount it, not to mention that if the Docker daemon is running as root I don’t see why you would have problem with permissions. Are you using Rootless Docker or maybe Docker Desktop? Did you install Docker as a snap package (could happen on Ubuntu)?
Homebrew is supported on Linux as well, but it is most likely to be used on macOS. If you run macOS, you run Docker DEsktop so you can’t just mount something from the Homebrew folder. You have to add that to the shared folders in the Settings of Docker Desktop, otherwise you just try to mount a folder from the virtual machine where it doesn’t exist and will be created as empty.
But I wouldn’t mount it at all, since that would just mount something built for macOS and wouldn’t work in a container. At least if I’m right and you use macOS.
This solved my similar problem where I had a single file that was bound/mounted, but changes to the file inside and outside the container were not reflected. When I changed the permissions to the file outside of the container to 666 (not the ideal solution), changes made inside/outside were reflected in the other place.