Running openHAB 2 in Docker

docker
openhab2
Tags: #<Tag:0x00007f014c27f2a0> #<Tag:0x00007f014c27efa8>

(Capo) #82

Thanks a lot!
Champ!


(Marco Höfle) #83

Hello Rich,
you are right, having a separate container for postfix is the more elegant solution.
Thanks
Marco


(Nicklas Nybom) #84

Thank you very much :slight_smile: Now i just gonna get my Tellstick working :slight_smile:


(J Wee) #85

Hi,
Newbie here.
Running Ubuntu 16.04 as VM under esxi 6, ad have installed docker CE, and pulled the openhab 2.2.0 amd64 debian image.
How to I get attach my gen 5 Z stick ( which shows up as Bus 2 Device 004 ID xxxx:xxxx Sigma Designs) to the openhab docker? And for that matter, how to do so for the Telegesis Zig Bee USB stick?

thanks!


(Rich Koshak) #86

Passthrough the USB devices to the VM.

They will show up as /dev/ttyUSB? where ? is a number… You will have to figure out which number is which USB device.

Use the --device option to docker run, e.g. --device=/dev/ttyUSB0 as described in the readme for the image on dockerhub and github.


(J Wee) #87

Unfortunately my motherboard, an Intel S1200kp does not allow VT-D and I cannot passthrough. But I can attach the USB device to the VM. Will that work as well?
when I do a lsusb command , it only shows up in the way I have described

Thanks for your help.


(Rich Koshak) #88

If it doesn’t show up as a file under /dev as a try file then the bindings can’t access it whether or not you are running in Docker.


(J Wee) #89

Found it! its /dev/ttyACM0

How do I automatically add the z stick whilst creating the docker openhab container?


(Rich Koshak) #90

I already told you.


(Matthias) #91

Hi there,

I’m looking for on option to pre-install a certain set of bindings into my openhab2 docker container. Usually I have something like

  • Binding: Astro, Exec, Expire, MQTT, NTP
  • Misc: REST documentation
  • Persistence: MapDB, RRD4j
  • Transformation: Exec, Javascript JSONpath, Map

in a fresh install / container.

I do not like to use addons.cfg but rather prefer something like PaperUI or Karaf. Is there a script hook or something already prepared for OH2 in docker to pre-install such a list of bindings?


(Rich Koshak) #92

addons.cfg IS is the script hook or something to do this.

But now that the container properly manages upgrades, now as long as you maintain userdata outside the container all of your bindings will be there as you move from container to container, even if you change versions.


(jeshab) #93

Update

I moved my initial post to a separate topic per @rlkoshak recommendation.


(Rich Koshak) #94

I recommend posting this as a separate tutorial so it is seen by more people and easier to find.


(Slaviša Lukić) #95

These entries are creating an issue when run on a MAC .

docker: Error response from daemon: Mounts denied: 
The paths /etc/timezone and /etc/localtime
are not shared from OS X and are not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.

Any known solution for this.

/etc/localtime is a link on MAC

lrwxr-xr-x  1 root  wheel  43  5 Apr  2018 /etc/localtime -> /var/db/timezone/zoneinfo/Europe/Bratislava

/etc/timezone is not existing at all.
What is the impact to ommit these 2 entries?


(Rich Koshak) #96

I don’t run on a mac. It seems likely that those files don’t exist on Mac or are put somewhere else. Those to lines set the timezone and local time inside the container to match the host.


(Michael ) #97

Hi all,
I really like the docker install - it makes the install smooth.

I have a question: What about updates of openhab?
On the Raspberry PI, I logged in, made the openhab-config and performed the update. How can I do this with docker? I guess I just pull the new image - but is there a notification that a new docker file is available ?!?!

Again: Great job to all contributors!
Michael


(Rich Koshak) #98

Yes, just pull the new image and create a new container. There is no notification but the new releases are usually available within a couple of days off the initial release.


(Wouter Born) #99

PR #213 just got merged which adds some new tags and makes use of multi-architecture manifests. It allows for Docker to download openHAB architecture specific images without having to specify the architecture in the tag.

See also the updated README:

For specific versions use:

  • openhab/openhab:<version>
  • openhab/openhab:<version>-<distribution>
  • openhab/openhab:<version>-<architecture>-<distribution>

For the latest stable release use:

  • openhab/openhab
  • openhab/openhab:latest
  • openhab/openhab:latest-<distribution>

For the latest release that has a milestone or stable maturity use:

  • openhab/openhab:milestone
  • openhab/openhab:milestone-<distribution>

For the latest snapshot release use:

  • openhab/openhab:snapshot
  • openhab/openhab:snapshot-<distribution>