cockpit-podman
cockpit-podman copied to clipboard
Clone or Copy feature is missing
the possibility to clone or copy an existing container is really annoying. It is not funny to configure the same stuff again and again in case of update or SELinux destroying the container...
Please no comments like do it in CLI it is quick, I do not care... Otherwise we can delete Cockpit ;-)
Interesting idea, haven't seen it before :) Does podman (or docker for that matter) provide such functionality? If so, can you please provide cli command that does that? (I am not suggesting you should do it on command line, I just need to see how this behaves and what it actually does to be able to model it for cockpit-podman as well). If it is not a thing in command line clients, what should it do?
Hi marusak, example for update of a container: You stop the existing one and you issue the same command again, you just change the Name. But as Cockpit is UI based it would be great to just click on clone and, as it has all information, fills the needed fields out so that I just have to change the name. Everything is filled automatically by using the known information from the existing container,
Here an example how it is handled by RancherOS which I currently use as main system for container I just started to test FCOS and so I am testing cockpit as well :-).

I see, so it would only open Run dialog with pre-filled values. That would be nice and should be simple to implement as well.
Copy would just open dialog.
Clone would immediately start it.
(or the other way around - maybe better wording could be used).
We also need to think if we want to omit the name and let podman generate a random one, or if we want to do something like <current_name>1.
Portainer also allow to edit existing containers. It opens a modal with existing data and at the bottom the button says "Duplicate container" to make it clear it won't be the same as it is only copying the config data (volumes, ports, env, etc)
We have a "Recreate" action in the menus of the redesign @ https://github.com/cockpit-project/cockpit/discussions/16059#discussioncomment-1051522 and I had it at the bottom of my notes @ https://github.com/cockpit-project/cockpit/discussions/16059#discussioncomment-1663195.
@marusak, @jelly, and I have talked about such a feature recently too in recent a video call and in IRC a few times (before and since).
Recreating a container could cover these cases:
- Create a similar container in parallel, but with different ports (if using ports) and volumes (if using volumes).
- "Edit" the container by recreating it and stopping & removing the one it was based on, adjusting fields, and removing the older one before this new one is created and started.
- "Freshen up" an container with a new image, but same (or revised) settings. There could be an option to pull the latest version of an image from a remote too, instead of using the one on disk (which could be outdated), so this could be a way to "freshen up" a container.
(You would be able to edit settings with a fresh image; these aren't mutually exclusive. Likewise, you could want to create a similar container with a new version of the image to test a staging version on another port.)
We haven't settled on what to call it; as it's not really editing (as the original would be thrown away), and if you're cloning it it's not recreating it (as both exist).
It basically comes down to having a create container dialog that's prefilled with an existing container and it would include two additional settings: replace origin container (or not), download new version of the image from remote registry (or not).
We could hardcode the replace option (and not show it) and have two different actions in the menu; one for "Rebuild and replace" (or "Edit and replace" or something similar) and another for "Clone". They'd basically bring up the same dialog but one would replace the original and the other would force you to change the ports, volumes, etc. that are exclusive. That might be more clear than a checkbox or a set of radio buttons, even if it's implemented similarly. (The freshen up option would have to be an option still though.)