-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Volumes in a non default location breaks the setup #45
Comments
I believe that what is happening is that the image has files in those directories, thus directories like /var/www/html/data are overridden by empty ones when the volumes are mounted. Docker initializes named volumes with the contents of the image so this problem doesn't happen. |
I am trying to do the same thing for the same reason and seeing the same issue. I have tried running the original docker-compose file to create a good set of volume related files in /var/lib/docker/volumes, shutting it down, then copying them to where I really want them and updating the docker-compose file to point there and then bringing it back up. It throws a forbidden error so clearly I don't understand enough about how docker works to solve this problem at this time. |
You can use a third one time "init" container to copy the correct files to the non default location bind mounted volumes. I am attaching an excerpt of a working docker-compose.yaml file that bind mounts /data/docker/partkeepr/{conf,data,web} as volumes and attaches them to the partkeepr , partkeepr-cronjob and partkeepr-init containers.
|
ngtech's solution worked for me. I also copied over the database seperately from the standard location to the custom location and it works as intended. |
I had a similar issue with a container running in a Kubernetes Pod and using an init-container like @ngtech mentioned worked like a charm. Thanks! |
I cloned the git repo and edited the docker-compose file so that volumes are located in a known location. This is something that I always do for docker projects so that I can backup the volumes easily. When i changed the location of the volumes for this partkeepr container the http://localhost:8080/setup/ gives this error:
Not Found The requested URL was not found on this server
If I keep the original docker-compose file the setup works.
Can someone help me to solve this problem? Or is it not possible to change the volume locations?
My docker-compose file:
The text was updated successfully, but these errors were encountered: