Closed RHCPNG closed 5 years ago
The reason that it does not work is that you use binds instead of volumes. When an empty (new) volume is mounted in a container, Docker will copy the data from the container to the mounted volume at first start. On the contrary, when binding a directory from your host, Docker will never do this. The solution to persist your data is to created (named) volumes instead of binds.
If you want to use binds, you need to apply some bootstrapping:
/etc/cmh-ludl/
to you hosts directory, e.g. /srv/dockers/openluup/cmh-ludl/
Thanks for your answer! I will try your solution and let you know.
Is it also possible to make the docker work with bindings? Because my experience is that most dockers work that way.
You can use binds for any volume except for /etc/cmh-ludl/
. Typical software separates code from configuration. Vera luup on the contrary is different and hence also Openluup. This specific location is where Vera stores all luup and plugin files, including configuration.
The volume for /etc/cmh-ludl/
contains the actual OpenLuup installation. It thus belongs to the image. Reason that you want to store it in a volume is that this volume allows you to preserve installed plugins and your configuration. It will survive recreation of the openluup container instance.
If you handle your data in spirit of containerization, it should be portable, A container can run anywhere. Using binds ties storage to a machine (typically, with default storage providers). Using volumes abstracts from that, which is why Docker prefers that approach.
Thanks for your detailed explanation, vwout!
I will read up on how to use this structurally in the future.
Hi vwout,
Thanks for your docker! I'm trying to run it on openmediavault and I'm using a GUI to create the docker, but I get this error in the subject.
I think it has to do with the volumes, these are apparently empty. But I'm used to doing it this way, but with your docker it doesn't seem to work. Can you help me out?
Regards,
Niels