-
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
RFE: podman container clone command #9540
Comments
On a similar topic, a "create from config" (either the json obtained from podman container inspect or something else) would be great. I couldn't find anything that looks like that but might have missed it. EDIT: Ah, now I'm looking for that specifically there's |
A friendly reminder that this issue had no activity for 30 days. |
These requests are great, but opening a PR would help move this forward. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@mheon another month, no activity, do you think this will ever be done? |
Now that |
I might need some help, but I can work on this in a few weeks |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
@infiniteregrets @mheon Did either of you work on this? |
@rhatdan sorry, got really busy with school couldn't get time to work on it |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
A friendly reminder that this issue had no activity for 30 days. |
this is done with #13059 |
So does that mean no chance at either editing the json specs or inputting them to a podman command to create a new container? |
One particular issue I would hope to be able to fix with clone is when the bind address I had previously passed in podman run or podman create is not bound on the host anymore, so I can't start the container anymore, even in the case I might be fine without that particular port published. Right now I am forced to create the containers "from scratch" when for some reason addresses in the host needs to change. |
hi @rbertoche thanks for reaching back out! When implementing a new command, usually not all of the flags are added at once to keep the PR diffs below multiple thousands of lines. That being said, the goal is for all flags for podman create/run to eventually be applicable for clone. Would you like to submit an issue with a priority list of a few flags so I know where to get started? |
your podman version is probably just too old? not sure when it was added but it's present in podman 4.1 here. |
@yule-sun, saw your email with this question. like @martinetd said, your podman version is out of date. Depending on what OS you are on, you might need to build from source (this github repo) in order to get this feature. |
/kind feature
Description
In other issues there are multiple reference to plans to implement 'container clone', but I see no issue that actually tracks such a new command.
( #7555 (comment) points to an issue about
container rename
that barely made it to 3.0 but no trace of clone there, #376 talks about creating an issue for this as well but nothing has been done that I could see)Ideally the command would also let modify any of the create arguments on the fly as override from the cloned source, so e.g.
podman container clone -p 5000:5000 source_container dest_container
overrides bound ports (there need to be some decision on whether that removes any other published ports first or not, for example systemd-style override would just append ports unless an empty parameter was passed first to unset everything)Also would need an option for image change, and ideally (can't hurt to ask) an option to immediately remove the old one and start in its stead, in which case it could reuse the same name (instead of using a temporary name, stop the old one, rename/start the new one)
Usecases
The most obvious usecase would be pet containers, e.g. for people who keep adding more options over time and end up with a very complex container that is currently very painful to recreate.
I end up never using
podman container create
and have a breadth of scripts with long linespodman container run
for this use case, and killing/rerunning them if I change some option.it'd be much simpler to
podman container clone --replace --whateverchange oldcontainer
A second usecase that won't get much traction would be autoupdate on systems that don't have systemd (e.g. alpine), alpine now has podman in its community repo on its latest version so podman 3 will be widely available and I believe it would make a good "barebone container host" -- but it has no systemd, so autoupdate isn't useable.
A simple script that pulls, check if image changed, and clone/replace would be easy to implement if we could clone containers, but it's neigh impossible right now.
Thanks!
The text was updated successfully, but these errors were encountered: