Docker & mysql

Hi -

I’m kind of new to Docker, though I’ve been using openHAB on and off for a couple of years.

I recently rebuilt my setup and installed the official OH docker image. After fighting and winning the ZWave/udev issue, I thought I’d set up a chart of my thermostat temperature reading…

That’s when I discovered that the mysql add-on isn’t present in Paper UI. In fact non of the persistence add-ons are present.

So, it looks like mysql isn’t installed in the container and can’t be accessed from the host (I did say I’m new to Docker), I have the following questions:

  1. What is the RIGHT way to add persistence?
  2. Am I correct that the mysql add-on isn’t available because mysql isn’t installed?

Thanks for the help!

Indeed yes, no external services are installed inside the container. Docker containers are intended to be “just enough to run the one program”. If you are going down the path of dockerization, you will need to run MySQL in it’s own container.

At this point you will have two choices depending on whether you have anything else that needs to talk to MySQL. You can set up a private network between the OH container and the MySQL container, or you can expose the MySQL container’s ports and have OH access it as if MySQL were running on some other computer.

But none of this addresses the lack of the mysql add-on. So the usual questions apply:

  • what version of OH are you running?
  • where are you looking in PaperUI? or are you installing bindings some other way?
  • what package did you choose when you initially opened the openHAB Dashboard?

Thanks for the education :slight_smile:

I’ll go ahead and plan on adding a mysql container as well.

I’m running openhab/openhab:latest (which is 2.4.0).

I’m looking in the add-ons section (I thought there were supposed to be more tabs?):

There isn’t a mysql entry anywhere in there.

The question about package is an interesting one… I fooled around a bit with the docker image getting it to work, but I don’t remember being asked about which package…

Looking into addons.cfg, I see “#package = minimal”, so a package isn’t explicitly set… is there a default value?

Thanks

RTFM: the packages webpage does indicate that I’m using the “minimal” package…

I’ll try changing that setting to standard and see where that gets me.

That’s why I asked the questions I did.

The package is set by clicking on the Dashboard when you first connect to it. Unless you explicitly manually edited addons.cfg, that file is having no affect.

It looks like you chose “Simple” as the package on that initial Dashboard screen when you first started OH (assuming a fresh OH install) which installed all the transformations and all of the persistence add-ons for you by default but also hides a lot from you. I don’t know how to change the package through PaperUI but I do know you can change it by removing the comment from that package line (i.e. delete the “#”) and leave it as minimal.

Yeah. Thanks for the pointer…

I changed it to standard, and the addons I expected to see resurfaced.

I appreciate your help!

–> I’m reading your persistence design pattern thread now.