That’s great! Making me consider the docker!
Yours was slightly smoother than my apt update. Although some of the bindings I use have had changes seems like in every milestone. That was the root of my issue.
That’s great! Making me consider the docker!
Yours was slightly smoother than my apt update. Although some of the bindings I use have had changes seems like in every milestone. That was the root of my issue.
@BrutalBirdie hello here
Just getting started with Docker / Docker Compose, my Linux skills are not much better and I have a ‘few’ questions
Setup:
Questions:
Sorry for all these noob questions, tried to answer as much as possible on my own with google, openHAB guides & docker guides
Hey there @fex
Docker Hub
Group id will default to the same value as the user id. By default the openHAB user in the container is running with:
uid=9001(openhab) gid=9001(openhab) groups=9001(openhab)
Make sure that either
groupadd -g 9001 openhab
useradd -u 9001 -g openhab -r -s /sbin/nologin openhab
usermod -a -G openhab myownuser
docker run \
(...)
-e USER_ID=<myownuserid> \
-e GROUP_ID=<myowngroupid> \
(...)
You can obtain your user and group ID by executing the id --user
and id --group
commands.
I will check that since I had no permission issue so far, might be because my user is also called openhab
edit: Checked you are right! I updated my setup to include UID:GID for openHAB but forgot to push it, sorry for that. github commit
The .env
will be loaded default by docker-compose nothing else needed.
I just wanted to split up the “config” env for the services.
See docker docs environment-variables
No the openhab_ro
user is an influx user which only has readonly permissions.
Grafana needs to be setup up by hand.
I will also take a look at this again If I am 100% correct.
Yep, this just set’s a variable for the “root” of the script path.
In case I update the script to jump around in folders the __DIR__
will always be the root of this script path.
Okay, I should create a better README got it
Get Started:
This will “deploy” a new openHAB instance with all mentioned services.
Cheers
Thx for your detailed and fast reply
One follow up question in regard to the composer file - any difference between the following two options (you use both)?:
I defined in the .env
file the GID und UID as 1000 since this should be the default UID and GID for the first user on linux.
Note to me… this should be in the README…
Grafan would use by default the UID and GID 472 thus I told grafana to use the defined 1000 in the .env
I think I got the .env file and the values for UID and GID - and I would think that you are using the values from the .env file in both cases.
My question is about the syntax - does the one liner ‘user: “${UID}:${GID}”’ result in something differently than the two lines ‘USER_ID: ${UID}’ & ‘GROUP_ID: ${GID}’?
I just noticed that you are using one form (the two lines) in the openhab section and the other form in the grafana section and I’m asking if these get different result…
My understanding in both cases would be that you’re telling docker to generate a user with the stated UID & GID - or am I wrong?
Ahhhh I miss read / misunderstood your question.
Well… openHAB docs stated they use USER_ID and GROUP_ID and grafana stated user: will work so I went with that.
I think I tried user: ${UID}:${GID}
for openHAB and it did not work. (I THINK, I will try it again) so I followed the README and it worked.
I will just assume now, no professional statement now.
openHAB Docker decided to use USER_ID as a variable and grafana took UID that’s why.
UNPROFESSIONAL STATEMENT - DID NOT RESEARCH - TAKE WITH A GRAIN OF SALT
And the next question : You put all subfolders (other than openhab_addons) into the gitignore file.
Is that just because you don’t want their content in your eze-openHAB-docker repo, are you actually not versioning their content or do you use separate repos for them (aka one repo for docker related stuff, one for openhab config, another one for what do I know…)?
Exactly. The eze-openHAB-docker git is meant to be a template.
All the sub-folders are private data and are not meant to be in this git repository.
I backup and version openhab_conf etc with a git submodule and via crontab rsync to my private cloud.
And another question - not directly related to your setup : Is it possible to use the OpenHAB Log Viewer with a openHAB Docker installation? Or is that one only available via openHABian?
I mean the web log viewer on port 9001 .
Means I would have to set up an an additional container for frontail, it doesn’t come with the openhab container, right?
I will prepare an example with docker-compose.
Give me a sec.
Nah will add it to the eze-openHAB-docker setup
@BrutalBirdie found an example for an openHAB frontail compose file
To get the css & and the json file I followed this advice from @Dim:
In your docker compose folder:
mkdir frontail
wget "https://raw.githubusercontent.com/openhab/openhabian/master/includes/frontail-theme.css" -O ./frontail/openhab.css
wget "https://raw.githubusercontent.com/openhab/openhabian/master/includes/frontail-preset.json" -O ./frontail/preset.json
With that I got an working container with the following config:
frontail:
image: "mthenw/frontail:latest"
container_name: "frontail"
restart: always
network_mode: host
command: --disable-usage-stats --ui-highlight --ui-highlight-preset /frontail/preset/openhab.json -t openhab -n 200 /logs/openhab.log /logs/events.log
depends_on:
- openhab
volumes:
- "${PWD}/frontail/preset.json:/frontail/preset/openhab.json:ro"
- "${PWD}/frontail/openhab.css:/frontail/web/assets/styles/openhab.css:ro"
- "${PWD}/openhab_userdata/logs:/logs:ro"
ports:
- "8001:9001"
EDIT: Added advice how to find the openhab frontail css & json files
Hi,
in my setup I use Ouroboros to check for new versions on docker hub and automatically “install” the new version. This works really great for all my containers (nextcloud, iobroker, …), however, when updating a major release for openHab and the version number changes (Environment variable is set in my container setup: OPENHAB_VERSION), which is checked in the entrypoint.sh file, the update fails.
I need to manually change the OPENHAB_VERSION environment variable to trigger the update, which is then successful.
If I completely remove the environment variable, the container does not start anymore.
Is there any chance to remove this dependency of the environment variable to be able to automatically update without any modifications?
Thanks a lot
Could you please be a bit more precise?
I have no clue what environment variable you talking about…
Are you talking about my setup? Are you talking about your setup?
My setup has only .env file which have the UID and GID set
UID=1000
GID=1000
which get’s used by openHAB in docker-compose
USER_ID: ${UID}
GROUP_ID: ${GID}
Hi, sorry I thought my question would fit to this thread regarding the update process of openHAB using docker.
It is about my setup, using the image from docker hub with the pre-defined environment variables, where OPENHAB_VERSION creates problems when updating to a new release.