In your Docker setup you are using volumes to preserve data. The volume openluup-env
is mounted at /etc/cmh-ludl/
. This means the files that are stored in /etc/cmh-ludl
are kept in the volume openluup-env
and not in the container created from the image vwout/openluup:alpine
.
This is the reason why e.g. L_Reactor.lua
is not in the tar file created by docker export
- the export command does not export the contents of volumes.
The reason that you do see some lua files in /etc/cmh-ludl/
in the tar file, is that my image contains openLuup. Upon mounting of new empty volume, Docker will copy the files of the mounted destination location, to the volume. New files that are added later, e.g. when you install the Reactor plugin, are stored on the volume and not in the container, nor (of course) does it modify the source image.
This also explains why using binds (-v /volume1/docker/openluup-env:/etc/cmh-ludl/
) fails openLuup to start properly. Unless you manually copied files to /volume1/docker/openluup-env
, this folder is empty and does not contain openLuup.
In contrary to new (empty) volumes, Docker does not copy the files from the destination directory to the binded filesystem.
To see which files are in the volume openluup-env
, mount it and run ls
. You can mount the volume to any container, but you can also start an interactive shell inside the openluup container that you started from vwout/openluup:alpine
, e.g. using docker exec -it <id-or-name of openluup container> /bin/sh
.
To backup the contents of openluup-env
, you also could mount the volume to a secondary container. An alternative is to mix mounts and binds. Use a volume mount for the openluup environment and binds for logs and backups:
sudo docker run -d -v openluup-env:/etc/cmh-ludl/ -v /volume1/docker/openluup-logs:/etc/cmh-ludl/logs/ -v /volume1/docker/openluup-backups:/etc/cmh-ludl/backup/ -p 3480:3480 vwout/openluup:alpine
(or add arbitrary other mounts to other locations)
When you now run the following command, the created tarball will be stored on your filesystem in /volume1/docker/openluup-backups
.
docker exec <id-or-name of openluup container> tar -C /etc/cmh-ludl/ -czf /etc/cmh-ludl/backup/openluup-env.tar.gz