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
Map read/write filesystem layer to new container #3044
Comments
@parente Why can you not use |
I'm not opposed to using volumes, but would it enable me to capture changes anywhere in the file system? Like in my #2 above, if I add users to the container, changes appear in /home, /etc/passwd, /etc/shadow, etc. Wouldn't this entail VOLUME /? Is that even possible or desirable? |
Also why wouldn't you commit the underlying container? |
I'm not sure how committing helps with upgrading the read-only layers to include the ftp server in my example. Maybe I'm missing some nicety of commit that allows it? I should be clearer and say I'm running multiple instances.
How do I roll out that ftp server to all the running containers? I was wondering if it would be possible to somehow swap out the read-only layers of all the running containers (parente/sshd:v1) and then stick the write layer back on top of containers spawned from parente/sshd:v2. |
@parente Thanks for the responses. I'll have to think about how to solve this issue. I believe it can be done with a commit and volumes. I'll get back to you soon if you don't fine a good solution in the meantime. I think reusing an rw layer is very complex and lead to bad things. Hopefully we can solve this with the standard docker command set. |
@crosbymichael No problem.It could very well be this can be solved with the features already in docker and I'm missing the magic combo that does it. I'll post if I find something along the lines of commit and volume in the meantime. |
Would it be possible to map the read/write filesystem layer from a stopped container to a run of a new container spawned from a newer version of the container image?
Let me explain by example. Say I build an image parente/sshd:v1 from a Dockerfile that sets it up to act as a little box with ssh enabled. I docker run an instance of it named "teambox1", ssh in, and set up 5 user accounts. All 5 users use the box for a while, changing their passwords, putting pubkey pairs in to simplify auth, copying data to it, etc.
Now a month later, let's say I update the Dockerfile to also run a ftp server on the box. I rebuild parente/sshd. Now I want to somehow update my "teambox" instance to take advantage of the latest and greatest ftp feature. My options seem limited:
What I'm wondering is if Docker could support something like the following:
where the magic
-reuse-write-layer
would mount the the top layer of the filesystem from the "teambox1" container as the top FS layer in the "teambox2" instance. It would be fine if I had to stop the "teambox1" container before running this command to avoid two containers accessing the same layer at once. Having this would make it trivial to migrate all FS changes from one container to the next, regardless of where they appeared in the filesystem.I understand that if I did this for two completely incompatible images it would fall all over the floor, but maybe there's a way to detect that? Or maybe it's an "advanced" feature where ymmv?
The text was updated successfully, but these errors were encountered: