How to Modify the Configuration of Running Containers

  docker, question

I open a docker container:

clipboard.png

The configuration item IP in the container is: 10.241.93.21.
Now due to the problems of network environment, the ip address has changed. It is necessary to replace the easy IP with 10.241.61.20.

Ps: It is required not to delete the existing container, and the ip address will still be 10.241.61.20 after the next restart.
How to configure? How to find it. Thank you!

You are using it in the wrong way. Containers should not be permanent. To maintain the discardability of containers, rm should be removed if there is a problem. The data should be stored outside the container and then run the new container directly. The parameter modification was made at that time.

In addition, you should use DNS. If it is an internal machine, you can also use internal DNS instead of writing dead IP.

Both approaches have problems. As for modifying the configuration inside the container, this is not recommended. The container is not a virtual machine and the configuration inside it should not be modified.