-
Notifications
You must be signed in to change notification settings - Fork 18.6k
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
How to refresh symlinks mounted to a docker data volume? #13382
Comments
This won't work because docker is resolving this symlink when it mounts it in. |
OK, so my only choice is to mount the parent? Alternatively would it be possible to image/run the original data container so that the --volume switch can be reapplied but the internally stored changes are maintained? |
Hmm, this might work. |
Glad to hear you're confident :D, I'll give it a whirl then, thanks! |
I'm going to close this issue, because this is more of a "question" than a bug in Docker, but feel free to continue the discussion. |
I am experiencing similar issue using data volume container and symlinks but not sure if @carn1x's workaround would work for me... It seems to me that Docker de-references symlinks pointing to data volume container at second run. Goal: I wanted to set up an application container and store the applications' data in a data volume container. Installation of softwares is done in The data volume container have the volume At second run, symlinks in application container should still be there and data volume container should contain the data produced by the application. The issue is that content of Steps to Reproduce: Here is "context creation" code (this will create
When running
Output analysis:
I am clearly missing something here that makes Docker, at second run, overwrite the symlink and/or copy files from data volume container /datas/app1/storage to application container?
|
@carn1x, can you expand on your workaround? I am trying to solve the same problem, but I do not understand how you achieved this:
|
@hcpss-banderson I did not achieve it, sorry to say. I ended up maintaining |
Hello, I am trying to achieve the same. @carn1x did you mean that you tried to mount the parent and both changing the symlink on the host or in the container failed? So the only solution to this problem is to mount the |
I'm running a docker data volume as per the method documented at https://docs.docker.com/userguide/dockervolumes/#creating-and-mounting-a-data-volume-container
One of the volumes I'm mounting is a symlinked folder linking to the latest version of a codebase. Currently I destroy the container and run it again to refresh the mounted folder but is there a more graceful method to deal with this?
So I have the following directory structure:
And the docker data volume runs with
docker run --name mydata -t -v /var/www/live:/data/www mydata
Destroying the container has the downside of losing the non external data of course.
Another method I suppose would be to mount a level above the symlink although then really I'm exposing more to the data container than I really need to and it seems sloppy.
Thanks for any ideas.
The text was updated successfully, but these errors were encountered: