Problem with addons folder in docker

Hello,

i finally took the time to try and find out more about my problem with the docker installation of OH on my Synology DS1517+.

From the Synology UI i choose the image i want to use, and add ‘Volumes’ on my host for backup reasons and the ease to access config files (was doing textual configuration in OH2 and now partly also in OH3). From my understanding the ‘Volumes’ in Synology UI are nothing else but bind mounts, right?

My problem always has been that i was not able to really use the addons folder, hence it is missing in the screenshot.
Either files i saved on the host in that folder never appeared when i checked inside the container, or after i created the folder ‘addons’ via putty with the respective uid/gid and rights the files appeared but didn’t take the correct ownership or rights.

I am now wondering if the reason might be within a file i found on github called ‘DOCKERFILE’
In line 19 and line 24 i can see the declaration of environment variables

19   OPENHAB_CONF="/openhab/conf" \
[...]
24   OPENHAB_USERDATA="/openhab/userdata" \

and also

20   OPENHAB_HOME="/openhab" \

later on in line 99 the volumes are exposed:

VOLUME ${OPENHAB_CONF} ${OPENHAB_USERDATA} ${OPENHAB_HOME}/addons

now my question is

  • is it possible that this is the reason for the different behaviour of the addons folder?
  • is there a reason to not also use an environment variable
    OPENHAB_ADDONS="/openhab/addons" \
    and expose all three later as
    VOLUME ${OPENHAB_CONF} ${OPENHAB_USERDATA} ${OPENHAB_ADDONS}?

maybe someone with a deeper knowledge of OH and docker has an answere for me.

Regards
T

This is going to be 100% a Docker concern. As far as OH inside the container is concerned, it’s looking at /openhab/addons.

I can’t see how.

Because the addons volume path is only used that one time whereas CONF and USERDATA are used multiple times.

Beyond that there is no difference.

But if you don’t believe it you can try it out.

Ultimately there is no difference from the Dockerfile perspective between the three volumes and I can confirm that the addons volume works on my system. So the difference/problem will be something weird that Synology is doing or something wrong in how you defined the volume parameter itself.

1 Like

Thanks Rich for the fast reply.

seems back then i approached the problem from the wrong side.
I remember i created a user on my Synology (shell) with uid/gid 9001 - BUT Synology
overwrites all user, group stuff from their own internal database. So you can only create a (permanent) user from the GUI (DSM) and there you can’t chose any uid/gui.

So i logged into the shell and did a
id <username for openhab connections>
and started my docker container with his uid/gid as environmen variables.

Had to do some recursive chown`s on the folders, too, but now everything is working as expected.

Thanks for pointing me (again) in the right direction