Docker Community Forums

Share and learn in the Docker community.

Edit configuration.yml file

build
docker
amazonwebservices

(Ankurgla22) #1

I have installed REDMINE using docker and I have to edit configuration.yml file inside container.
I have to edit it but while I am restarting container, all file edited data is lost.
Is there any way to permanently edit the file of docker container?

Docker version 1.9.1 & OS is Linux version 4.1.10-17.31.amzn1.x86_64

Please have a look what i have done till now:
$ docker pull sameersbn/redmine:latest
$ docker pull sameersbn/mysql:latest
$ docker run --name=mysql -d -e ‘DB_NAME=redmine_production’ -e ‘DB_USER=redmine’ -e ‘DB_PASS=password’ sameersbn/mysql:latest

$ docker run --name=redmine -d -p 80:80 --link mysql:mysql sameersbn/redmine:latest

But to configure SMPT mailing server in Redmine container. I have to edit config/configuration.yml file. So,

$ docker exec -it redmine /bin/bash
$ vi config/configuration.yml
After editing and saving it.
$ exit

$ docker restart

After it when i recheck the edited data of config/configuration.yml then all data is lost. And file become as original one.


(Timgriffiths) #2

I have never herd of the file reverting on a restart, a recreate of the image yes but never just a restart, in any case the best practice is to create your own image with your changes ie something like

FROM sameersbn/redmine:latest
ADD configuration.yml /config/configuration.yml

or you can add it in from the host something like

$ docker run -v /data/configuration:/config/configuration.yml --name=redmine -d -p 80:80 --link mysql:mysql sameersbn/redmine:latest


(Tigerich) #3

I have the same issue as ankurgla22 on my 3.2.1 redmine release.

But I found this problem does not exist on 3.1.1 redmine release.

It would be preferred not to recreate the docker container instance.

More help is appreciated.

Richard