-
Notifications
You must be signed in to change notification settings - Fork 18.7k
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
Implement mount from image #48798
base: master
Are you sure you want to change the base?
Implement mount from image #48798
Conversation
c6b5bb0
to
fd65589
Compare
This is really awesome progress on a very old proposal, nice work! 🥳 From a usability perspective, I wonder if this needs to introduce a new There's probably also more tests this should add, right? Maybe some integration tests? (To be clear, I'm looking for more maintainer opinions on this -- please don't rush to implement any of my suggestions until we hear from others! 😄 ❤️) |
I was waiting on confirmation that how I implemented it was sound before adding the tests but will definitely add them |
❤️ Thanks for working on this!! Yes, definitely want eyes from @vvoland and @dmcgowan on this (I know some work is also in progress in containerd to support mounting from OCI artefacts, so we should check if things "conflict" or are "complementary".
Good point; was thinking that as well (as mounting form an image, especially if that image is a "runnable" image, likely would involve mounting only specific paths. FWIW; for volume we implemented sub-path mounts, so we could align with that; ☝️ like Tianon, this is also just a quick blurb from my side; happy to see this, but haven't looked at the nitty-gritty details yet! |
One unit test failure on Windows; probably needs to either be excluded if we can't support it on Windows and/or a custom error in the Windows mount parsing code to handle this case;
Looks like various "docker build" tests in integration-cli tests are failing, but not exactly sure what's happening there. |
f9fbcc4
to
b0cd75d
Compare
45b4df6
to
4ef1a7f
Compare
1c16223
to
317e809
Compare
one failure on Windows;
|
That's strange! It should be excluded as per https://github.com/moby/moby/pull/48798/files#diff-a60d56a02728a9de744c7445cb4b12e1a20dd0e99594b63e327ce7ed55fd63e7R141 and the build in my fork worked |
317e809
to
89496f5
Compare
Fixed. I think the failure now are transitive |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Overall the approach seems fine to me, but I still need to give this a deeper look.
At first glance, I think that the current implementation doesn't prevent the mounted images from being deleted by image prune -a
.
That case also deserves an integration test IMO 😄
@vvoland I didn't see that as a problem. Because it creates a UnionFS of the rootfs, deleting the image doesn't affect the running containers. It would only be an issue if trying to recreate the container. |
That being said, I can create an integration test to demonstrate the running container being unaffected |
89496f5
to
560928f
Compare
@vvoland added the integration test for deleting an image mounted to a container. |
0c68017
to
880b6a8
Compare
Signed-off-by: Laurent Goderre <laurent.goderre@docker.com>
880b6a8
to
06155da
Compare
Discussed in today's Moby maintainers meeting, with a few notes:
|
For the image to mount not being present locally, I would argue that it can be pushed after this gets merged because the feature is behind a flag that is not enabled by default. Currently the behavior is like this:
I think having the ability to pull multiple images on a single container create should be a seperate image that would improve the developer experience of this feature. |
I created a separate |
- What I did
Implement proposal #30449 of adding ability to mount an image inside a container
- How I did it
Repurposed the function to create the overlayfs for a container from an image and created an alternate that creates the file system from an image instead of a container definition.
- How to verify it
Integration tests were added for this
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
Fixes #30449
Refs docker/roadmap#718