-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Sharing volumes (via docker-compose) errors. #3557
Comments
I tried reproducing this issue with the excerpts you provided, but everything seems to be working just fine. One thing I see is that your
Without a full account of what has happened before getting to that point, it's hard to pinpoint the issue, but at that point it seems like it would be a good idea to clean up the containers using |
Hi @shin- Thanks "docker-compose" down worked; I was repeatedly trying "docker rmi -f XXX" which I thought would be a clean reset? Now that up is working, #2: I still can't find a way to have my "client" be able to access the volume defined by the "container." Again works fine by command line (per docs), but I seem to be missing something from my docker-compose.yml. Can you suggest a way to debug? My container's inspect has:
And I can "docker run ls" and view the timestamp test file that is created by the container's Dockerfile. But the client doesn't see this (and I'm not entirely sure from the docs if I need to do anything other than define volumes_from above). Thanks again for the quick feedback. |
As for the volume's visibility, things should work fine based on the info you provided. I added a
Is your actual usecase significantly different? Can you reproduce the issue with the stripped-down version you shared here? |
I think I got myself confused -- let me see if I have this straight: docker-compose both builds the images (when a build declaration is present) and runs new containers. Volumes persist after the container has exited (which is why the client can access the terminated volume container). But if I just issue "docker run" against the image (volumes_test_client) it's going to create a brand new container that isn't automatically connected to any volume, right? So, of course (now) I have to add --volumes-from to restart a new container that references the same volume from a previous container.
Makes sense now -- thanks very much. |
From the command line, everything works, from docker-compose, I have the following hello-world example (would be really useful if somewhere in the docs there were examples):
Dockerfile-container:
Dockerfile-client
"docker-compose build" returns OK.
"docker run volume_test_container cat /usr/share/timestamp.txt" prints the timestamp as expected.
"docker-compose start" returns OK.
But:
2). No combination of magic will enable the "client" container to see the contents of the "container"s share.
The text was updated successfully, but these errors were encountered: