Skip to content
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

Clone or Copy feature is missing #363

Open
S-B-V opened this issue Apr 23, 2020 · 6 comments
Open

Clone or Copy feature is missing #363

S-B-V opened this issue Apr 23, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@S-B-V
Copy link

S-B-V commented Apr 23, 2020

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 ;-)

@marusak
Copy link
Member

marusak commented Apr 23, 2020

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?

@marusak marusak added enhancement New feature or request question Further information is requested labels Apr 23, 2020
@S-B-V
Copy link
Author

S-B-V commented Apr 24, 2020

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 :-).

Bildschirmfoto von 2020-04-24 09-32-09
Bildschirmfoto von 2020-04-24 09-32-16
Bildschirmfoto von 2020-04-24 09-32-19
Bildschirmfoto von 2020-04-24 09-32-21
Bildschirmfoto von 2020-04-24 09-32-24
Bildschirmfoto von 2020-04-24 09-32-32
Bildschirmfoto von 2020-04-24 09-32-35
Bildschirmfoto von 2020-04-24 09-32-37
Bildschirmfoto von 2020-04-24 09-32-40

@marusak marusak removed the question Further information is requested label Apr 24, 2020
@marusak
Copy link
Member

marusak commented Apr 24, 2020

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.

@Extarys
Copy link

Extarys commented Mar 29, 2021

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)

@garrett
Copy link
Member

garrett commented Nov 30, 2021

We have a "Recreate" action in the menus of the redesign @ cockpit-project/cockpit#16059 (comment) and I had it at the bottom of my notes @ cockpit-project/cockpit#16059 (comment).

@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.)

@Fuseteam
Copy link

Fuseteam commented Aug 16, 2023

i would like a way to do this, in docker we have docker-compose, which takes in a yaml file which can then preconfigure a container.

a nice example can be seen in authentik's documentation: https://goauthentik.io/docs/installation/docker-compose
podman does seem to have option to utilize yaml file in a similar fashion as noted on Nathan Lager's blogpost on https://www.redhat.com/sysadmin/compose-podman-pods

i'm currently attempting to setup authentik through cockpit-podman and i can affirm, it is not fun setting the container up over and over again just because it doesn't work the first few times (due to config mistakes mostly :P)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants