-
Notifications
You must be signed in to change notification settings - Fork 11
Binding Volumes On Host Not Working #9
Comments
I haven't looked too deep into the issue with bind volumes yet. I remember that in the past it resulted in a HTTP 500. It could be a permission issue on the folders with the wrong UID/GID mapping. That's why I used named volumes in the example so far. Not sure what is the recommended way of handling UID/GID mappings of bind mounts in the container, but it is something I will have to look into. |
Maybe this helps to resolve the issue? https://stackoverflow.com/a/56844765 |
Is there any progress in mapping the UID and GID to the container? |
@shufflerror afaik there is nothing I can do about this in the general container build. Either the container is rebuilt with your personal UID and GID or you map it in the docker compose file or docker run (see my comment and link to Stackoverflow above) |
@suntorytimed I meant it would be nice to have the UID and GID defined as ENV VARS, so everybody can set them as needed in their project. It is described in the last line of your link. "(or define UID and GID as environment variables)" Hope I will find some spare time to figure it out by myself in the next weeks. I'm relative new to Docker and it's the first time I have to modify an image. Little holiday project. Maybe something like this but with variables instead of arguments https://dev.to/izackv/running-a-docker-container-with-a-custom-non-root-user-syncing-host-and-container-permissions-26mb Thanks for your answer. |
Problem with bind mounts is that the expose the files from your machine to the docker, not the other way around. So you need to have the folder either links to another location in the docker volume, or set it up to propagate the files after the volume has been created. I've been messing around with this and I think I have a working version on my repo. I changed the dockerfile to install to /var/www/resourcespace instead of html, then mount the html folder, then the entrypoint script checks to see if config.php is present in the html folder. If not, it copies the contents over from the resourcespace folder - effectively giving you a "initialization" I'm still messing around with it (i'm not an expert in the slightest) and I still need to manually do some things post install to make it all happy, but it's a start. |
@Rukongai do you have this working. I was thinking about doing the same thing. You seem to be further along than me. I would love it if you shared your work. Thanks! |
You can try using mine on dockerhub. I see that I was talking about manual steps but I can't remember what they were. I ended up not using resourcespace for my project
|
I'm not having any success mapping the two volumes (filestore and include) to my host machine. The include folder has all of the expected files within the container, but when you try to map volumes on a host machine, nothing happens to the directories and when the container gets updated, all your files get lost.
The text was updated successfully, but these errors were encountered: