Edited files lose content after re-boot


I edited a file and after re-booting the new contents had disappeared. Why is that and what do I need to do to retain the edited file’s contents.
The file in question is /etc/default/gpsd

Thanks in advance.


Hi, as mentioned in the other thread, the way Docker works, changes are not persisted over container restarts. You you have to add your changes to your Dockerfile / template.

Would all your devices have the same /etc/default/gpsd settings? Because then you can have copy of that gpsd file in your git repository, and copy it to the right place in the Dockerfile with

COPY gpsd /etc/default/gpsd

Or there are other ways too (modifying things within a RUN ... step, for example, or dynamically generating the file on container startup), but it depends on your exact use case.

Hope this helps some!


Ah! - OK I understand now.
The file is the same for all devices so I will just copy it in the docker.template.

Thanks for your help. I’m sure I’ll get the hang of these ‘containers’ soon! :sweat:


Great to hear that you are on a good path! :smiley:
And no worries, ask as many questions as you’d like!