Overwritten File with docker cp command is reset when stop and start container.
OS: CentOS Stream release 9
Docker: Docker version 24.0.6 build ed223bc
While configuring and using the cluster, the assigned IP address changed, so I used docker cp to change the settings of the container’s cassandra.yaml file, but the settings were reset again.
1.container run with “A-ip”. cluster dc1 run without any problem.
2.host mahcine reassign ip address to virtual machine as bridged ip.
3.sudo docker cp cassandra-container:/etc/cassandra/cassandra.yaml /home/user/Desktop/folder/cassandra.yaml
#copy cassandra configuration file from container to host
4.vim cassandra.yaml and change value of seeds, broadcast_address, broadcast_rpc_address to “B-ip”(which is present IP address of vm)
#change configuration value of file
5.sudo docker cp /home/user/Desktop/folder/cassandra.yaml cassandra-container:/etc/cassandra/cassandra.yaml
#overwrite cassandra configuration file from host to container
6.sudo docker cp cassandra-container:/etc/cassandra/cassandra.yaml /home/user/Desktop/folder/cassandra-check.yaml
#Checking overwritten is applied properly.
#overwriting is applied correctly
10.sudo docker cp cassandra-container:/etc/cassandra/cassandra.yaml /home/user/Desktop/folder/cassandra-check.yaml
#checking configuration file
11.The values I changed have been reset to initial values.
Even after repeating the process and searching through the community to see where the problem occurs, I cannot find the reason. I would really appreciate it if someone could tell me a solution.