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
docker commit data container with VOLUME #6999
Comments
+1 Volumes are useful in many cases, for example, for running database-storage. However, since volumes are not 'part' of a container, it makes containers no longer portable - which seems in direct conflict with the slogan Build once... Run anywhere... |
+1 i need this @cpuguy83 |
@crosbymichael I thought about this, and potentially enabling it for all docker builds. |
I was thinking about this the other day; some things to take into account;
|
Fixes moby#6999 Docker-DCO-1.1-Signed-off-by: Brian Goff <cpuguy83@gmail.com> (github: cpuguy83)
+1 for the request by winggundamth At the time of this writing, I have noticed that $ docker commit does not commit the data within the volume mounted (in the case of a data-only container). It would be nice to have this request fulfilled in the case of a data-only container, it's much easier+faster to commit & run VS backup & restore. |
there a proposal about it right here, but it's closed now : #8484 |
+1 I take it the black-belt label means this is going to be harder than breaking boards with one's chin? |
👍 |
1 similar comment
+1 |
+1!!! |
I think going forward the work on top level volume objects will replace data containers and allow more advanced management of volumes with things like export. @cpuguy83 should have a PR somewhere or it is already merged in the experimental branch. |
#14242 for top-level volumes. |
Hello! Mainly:
Then from there, patches/features like this can be re-thought. Hope you can understand. |
Is this Fixed ? Still need to work round? Any one please update... |
I would also appreciate such a feature. Docker is flexible and there is not only one way to use it. |
👍 |
Well.. why would you even mention Dockerfile syntax? The issue is about run command. There is now direct answer to this issue, no merged PR, no opened PR, no info about why you can't do that, nothing. @thaJeztah reopen this issue, maybe? |
👍 |
+1 |
9 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1 |
+1. How else can we snapshot volumes |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
woo wee, that took forever to figure out why my @thaJeztah, or anyone else really, i am not necessarily seeking to commit a volume, but remove the volume declaration, and perhaps recreate it later? for instance, couchdb ships with a VOLUME declared. my objective is to ship a container with some prebaked data in it, but i can't run any migrations and recommit them because of this volume. if there is a recipe for the operation, i'd love to hear it. |
+1 |
While I commented to be "positive" on this issue in the past, I've since gotten more insight into the complexity and design problems this feature would bring, and implementing this as a feature would be very problematic. A volume is really separate from a container that's using it; commiting that data into an image will unlikely be implemented. Let me first try to illustrate what's happening when using a volume; If an image declares a
When commiting a container to an image, only changes to the container's filesystem are committed; because the volume is not part of that, those files are not committed. This is the intended behavior for most use-cases; volumes are designed to;
ComplexityImplementing this feature would introduce a lot of additional complexity;
What use-case would be resolved by this feature?The main use-case mentioned in this thread is to be able to ship an image that contains (default) data to use at runtime. There's a number of ways to realize this;
There are improvements to be made, for example: allow a With the information above, I think it'll be very unlikely this feature will get enough support among the maintainers to be implemented. |
so is there a way to commit docker image with files from volumes? |
No there isn't, other than copying the files out of the volume to another location in the container before committing |
These manual overview steps might work:
Let me know how you make out. |
Is this already solved? Can we commit now with persistent data to a image? |
Not solved. See the workaround described in the Jan 4, 2019 comment. |
+1, could provide this feature, and leave users to decide how to use it. |
could you provide me any idea, how to modify this feature in my own git code, I will try my own environment. |
+1 |
1 similar comment
+1 |
I'm not sure anyone has a way or requesting this but this is my use case.
I knew that there's a way to backup data container with --volumes-from, bind mount with host with tar as describe here. But it should be good if Docker have a way to commit data container to image with data in Volumes. So I can use it for snapshot/backup data and push/pull it to transfer data across server.
Use case example
Dockerfile
On host
On dev or another host
Do you have a plan for this feature or any work around to do snapshot on volume?
I know this will be very complicated but it will be the very nice to have feature for sure :)
The text was updated successfully, but these errors were encountered: