I start a mysql container and change the config file inside a container, in this case is /etc/mysql/my.cnf
. And restart container.
Maybe something wrong with that config file and the container cannot start. How can I edit that config file when the container has been shutdown?
A container is immutable, your changes and conf are gone. You should use a Dockerfile to build a custom image and include my.cnf.
It can be easily done, create a folder, create my.cnf in it and a Dockerfile with only two lines
Now build and run: