-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Support modifying published ports after container start #18309
Comments
I just realized I was still on 3.4 . Podman 4.1 appears to have a These two may also be relevant?:
|
We really try to avoid changes after the original container creation as much as possible. It is extremely difficult to support that. There are just to many corner cases. I also cannot stress enough that port forwarding in its current form is already extremely hard to maintain for me as there are so many ways to do it. On a stopped container this may be easy enough to support as we only would need to update the config in the db but for running containers it is just way to difficult. |
@Luap99 Being unable to edit port and folder mappings on a stopped container is the only thing holding me back from loving Podman. If a container is stopped, it should be safe to edit these things? |
Yes on a stopped container it is safe (just some db edit to change the mapping there), however exposing such functionality is still code we have to support. And at the point you stopped the container you could just create a new one anyway? Containers should really be treated as immutable for the most part. |
Not recommended obviously, but if you really need to do it, I have indeed just edited the config stored in the db. |
A friendly reminder that this issue had no activity for 30 days. |
We do not plan on implementing this feature, since you can just use --replace. |
Is there a way to modify published ports when the container is stopped? |
Sorry no, not in a supported fashion. |
Could this be ever implemented? It's possible in Docker, but since Podman uses a database file, it's next to impossible to do so manually. |
There is no plan to ever implement this. The supported way is to recreate the container. |
So how to recreate the container while retaining all data present in the previous container? |
Use |
Feature request description
There does not seem to be any way to change published ports after starting a container.
See also:
https://stackoverflow.com/questions/63641299/podman-pod-change-port-mapping
https://stackoverflow.com/questions/59920413/podman-add-ports-to-expose-to-running-pod
which cites https://developers.redhat.com/blog/2019/01/15/podman-managing-containers-pods#
I'm new and only now learning containers/podman, so I don't understand any nuances that may make this a deliberate design decision.
Is this a deliberate design decision or just not implemented yet?
I would also like this for network settings in general.
Suggest potential solution
I would like a podman subcommand for modifying port / network settings.
Have you considered any alternatives?
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: