-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for 'image' volume driver #15841
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mheon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Still needs manpage updates and tests. @vrothberg Thanks for the inspiration here, and PTAL when you get a chance |
So this is going to create a layered volume, just not necessarily an executable image? Interesting idea. |
Probably? Still need to work out the UI bits of how |
8bc4bc1
to
66a6b74
Compare
Manpages updated, test added. This should be ready. @containers/podman-maintainers PTAL |
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.
I see one big problem here, this is not backwards compatible. What if I called my volume driver image
in containers.conf. I think this needs to be rewritten so this can still work if this name is used in containers.conf
So prefer a volume plugin named |
Yes just so we are fully backwards compatible, I mean we store the driver name in the DB so once you update your stuff will break. |
@Luap99 Done |
You have a build issue but could you also a test test for this corner case, create volume, run container, remove volume. |
b0b1aa2
to
5860030
Compare
ffe6433
to
f541eee
Compare
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.
LGTM
Cirrus appears to be very angry. |
Rebased and force-pushed in the hope that CI will be less angry |
We added the concept of image volumes in 2.2.0, to support inspecting an image from within a container. However, this is a strictly read-only mount, with no modification allowed. By contrast, the new `image` volume driver creates a c/storage container as its underlying storage, so we have a read/write layer. This, in and of itself, is not especially interesting, but what it will enable in the future is. If we add a new command to allow these image volumes to be committed, we can now distribute volumes - and changes to them - via a standard OCI image registry (which is rather new and quite exciting). Future work in this area: - Add support for `podman volume push` (commit volume changes and push resulting image to OCI registry). - Add support for `podman volume pull` (currently, we require that the image a volume is created from be already pulled; it would be simpler if we had a dedicated command that did the pull and made a volume from it) - Add support for scratch images (make an empty image on demand to use as the base of the volume) - Add UOR support to `podman volume push` and `podman volume pull` to enable both with non-image volume drivers Signed-off-by: Matthew Heon <[email protected]>
CI seems to be passing now |
This is ready. |
@@ -17,7 +17,13 @@ driver options can be set using the **--opt** flag. | |||
|
|||
#### **--driver**=*driver* | |||
|
|||
Specify the volume driver name (default **local**). Setting this to a value other than **local** Podman attempts to create the volume using a volume plugin with the given name. Such plugins must be defined in the **volume_plugins** section of the **[containers.conf(5)](https://github.com/containers/common/blob/main/docs/containers.conf.5.md)** configuration file. | |||
Specify the volume driver name (default **local**). | |||
There are two drivers supported by Podman itself: **local** and **image**. |
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.
Do we support volume plugins?
/lgtm |
We added the concept of image volumes in 2.2.0, to support inspecting an image from within a container. However, this is a strictly read-only mount, with no modification allowed.
By contrast, the new
image
volume driver creates a c/storage container as its underlying storage, so we have a read/write layer. This, in and of itself, is not especially interesting, but what it will enable in the future is. If we add a new command to allow these image volumes to be committed, we can now distribute volumes - and changes to them - via a standard OCI image registry (which is rather new and quite exciting).Future work in this area:
podman volume push
(commit volume changes and push resulting image to OCI registry).podman volume pull
(currently, we require that the image a volume is created from be already pulled; it would be simpler if we had a dedicated command that did the pull and made a volume from it)podman volume push
andpodman volume pull
to enable both with non-image volume drivers