From 645e59a120d205ba331bf352cb675dec26ea6acd Mon Sep 17 00:00:00 2001 From: Dominik Krickl-Vorreiter Date: Thu, 14 Sep 2017 21:01:38 +0200 Subject: [PATCH] Clarify user configuration (#106) --- README.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/README.md b/README.md index 716d9b0..2ff808a 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,8 @@ Prebuilt Docker Images can be found here: [Docker Images](https://hub.docker.com **Important:** To be able to use UPnP for discovery the container needs to be started with ``--net=host``. +**Important:** In the container openHAB runs with user "openhab" (id 9001) by default. See user configuration section below! + The following will run openHAB in demo mode on the host machine: ``` docker run -it --name openhab --net=host openhab/openhab:2.1.0-amd64 @@ -177,10 +179,30 @@ You can run a new container with the command ``docker run -it openhab/openhab:2. * `OPENHAB_HTTPS_PORT`=8443 * `USER_ID`=9001 +## User configuration + By default the openHAB user in the container is running with: * `uid=9001(openhab) gid=9001(openhab) groups=9001(openhab)` +Make sure that either + +* You create the same user with the same uid and gid on your docker host system +``` +groupadd -g 9001 openhab +useradd -u 9001 -g openhab -r -s /sbin/nologin openhab +usermod -a -G openhab myownuser +``` + +* Or run the docker container with your own user AND passing the userid to openHAB through env +``` +docker run \ +(...) +--user \ +-e USER_ID= +``` + + ## Parameters * `-p 8080` - the port of the webinterface