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

RFE: Add "rename" subcommand for better Docker compatibility #1925

Closed
cjeanner opened this issue Dec 3, 2018 · 48 comments · Fixed by #8955
Closed

RFE: Add "rename" subcommand for better Docker compatibility #1925

cjeanner opened this issue Dec 3, 2018 · 48 comments · Fixed by #8955
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@cjeanner
Copy link

cjeanner commented Dec 3, 2018

kind feature

Description

Docker has a "rename" subcommand allowing to change a container name. This feature is missing in podman, and is useful in some cases.

Thank you!

@EmilienM
Copy link
Contributor

EmilienM commented Dec 3, 2018

I agree the feature from docker would be useful. Shutting down and removing the container then creating a new one isn't a valid answer when you run containers in production.

@mheon
Copy link
Member

mheon commented Dec 3, 2018

I was thinking about a podman alias command that would let you add/remove aliases that would act as extra names for a container. Changing a container's actual name would be very difficult for us do to the internal structure of containers, but I can easily let you add/remove additional names from existing containers.

@cjeanner
Copy link
Author

cjeanner commented Dec 3, 2018

@mheon hello :).
Sooo. an alias might work, but we'll need to find a way to make this alias work for tasks like "podman start " and the like.
Also, it would be needed to set a "preferred alias" or something that shows up in a podman ps output as the container name, else we will have "some" issues finding what container is running and so on.

Fact is, we really rely on the container name for a lot of tasks, and we need it to be as stable as possible - like docker ;).
Usages include:

  • podman ps --format "{{ .Names }}"
  • podman exec "..." NAME
  • podman start "..." NAME
  • podman stop "..." NAME
    and so on. So the name is important, and as we have a thing that manages both docker and podman engines, we'd like to get a really good compatibility in order to avoid code duplication, weird "if/then/else" and things like that that make the code hard to follow/maintain.

I don't know if @EmilienM has other thoughts.. ?

@baude
Copy link
Member

baude commented Dec 3, 2018

During a rename, can the container ID change ?

@cjeanner
Copy link
Author

cjeanner commented Dec 3, 2018

@baude I think the id can change - at least, I see no reason for us to base our workflows on ids as they aren't predictable, on the contrary to the name (hence the need of the "rename" :) ).

@mheon
Copy link
Member

mheon commented Dec 3, 2018 via email

@cjeanner
Copy link
Author

cjeanner commented Dec 3, 2018

@mheon hmm ok. well, I think we can give a try?

@mheon
Copy link
Member

mheon commented Dec 4, 2018

I think I can slot this in early next week

@cjeanner
Copy link
Author

Hello @mheon - any news for this? :)

Cheers,

C.

@cjeanner
Copy link
Author

hello @mheon - any news? We have a really ugly work-around, and would really appreciate something more "nice" :).

@mheon
Copy link
Member

mheon commented Feb 12, 2019

I'll bump it up the to-do list again, but no promises - things consistently keep managing to explode and require attention.

@rhatdan
Copy link
Member

rhatdan commented Mar 8, 2019

@mheon This probably goes along with the clone stuff.

@rhatdan
Copy link
Member

rhatdan commented Apr 13, 2019

Seems like this would be something for a new developer to take a stab at?

@mheon
Copy link
Member

mheon commented Apr 13, 2019 via email

@TomSweeneyRedHat
Copy link
Member

@dougsland interested in trying a Podman issue? Then we can get you a Podman sticker too!

@rhatdan rhatdan added the Good First Issue This issue would be a good issue for a first time contributor to undertake. label Apr 14, 2019
@dougsland
Copy link
Contributor

@TomSweeneyRedHat sure thing, let me check and dig this.

@weirdwiz
Copy link
Collaborator

weirdwiz commented May 8, 2019

@dougsland are you working on this issue? can I take this up?

@dougsland
Copy link
Contributor

@dougsland are you working on this issue? can I take this up?

@weirdwiz I am in a conference right now but my plan is continue on this next week. However, if you have any patch ready to go fell free to submit.

@weirdwiz
Copy link
Collaborator

weirdwiz commented May 9, 2019

@dougsland I see, I will leave you to it then as you are already working on it 😀

@rhatdan rhatdan assigned QiWang19 and unassigned mheon Aug 5, 2019
@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2019

@dougsland @ashley-cui @weirdwiz @QiWang19 Since this never made progress could someone verify that they are working on it, or grab it for themselves.

@QiWang19
Copy link
Contributor

QiWang19 commented Aug 5, 2019

I can take this if @dougsland hasn't stated.

@mheon
Copy link
Member

mheon commented Aug 5, 2019

To be 100% clear here: I don't think podman rename makes sense in current context. I would greatly prefer a podman container clone that makes a copy of an existing container, with changes.

@mheon
Copy link
Member

mheon commented Aug 5, 2019

(Aliases are also a potential option, but I think we should start with clone)

@rhatdan
Copy link
Member

rhatdan commented Aug 5, 2019

I am fine with this, as long as we have an alternative.

@TomSweeneyRedHat
Copy link
Member

FWIW, Docker has a rename.... https://docs.docker.com/engine/reference/commandline/rename/

@rhatdan
Copy link
Member

rhatdan commented Jun 9, 2020

@mheon Want to work on this with an Intern?

@mheon
Copy link
Member

mheon commented Jun 9, 2020

I think first step is probably to convert all of these various issues requesting renaming, updating, moving into pods, etc into one single podman container clone issue.

Beyond that, I need to do a bit of architecture work to figure out how this exactly should look, I don't know for sure how complex this is going to be.

@JeongHyeon-Kim
Copy link

I was looking for a feature and came here. I hope it will be added soon.

@rhatdan
Copy link
Member

rhatdan commented Aug 25, 2020

Best way to get new features is to open PRs :^)

@TomSweeneyRedHat TomSweeneyRedHat changed the title Add "rename" subcommand for better Docker compatibility RFE: Add "rename" subcommand for better Docker compatibility Oct 7, 2020
@rhatdan rhatdan added kind/feature Categorizes issue or PR as related to a new feature. and removed Good First Issue This issue would be a good issue for a first time contributor to undertake. enhancement labels Oct 7, 2020
@github-actions
Copy link

github-actions bot commented Nov 9, 2020

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Nov 9, 2020

Sadly coming up on two years on this one

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Dec 10, 2020

This one got a little more active this week.

@github-actions
Copy link

A friendly reminder that this issue had no activity for 30 days.

@rhatdan
Copy link
Member

rhatdan commented Jan 10, 2021

Still being worked on, not sure if it will make podman 3.0 though?

@mheon
Copy link
Member

mheon commented Jan 12, 2021

Being worked on in #8955
Will probably make 3.0 (although in an early and limited form)

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.