However, there was no solution
If you are using a self-signed cert you must add your CA to the JVM running inside the container. Java maintains its own collection of trusted CAs and will not trust your self-signed cert until you add your CA to the list.
I don’t know how to do this with Zulu which I’m pretty sure is the Java that comes in the docker image.
Thank you for the clarification.
I solved it by building a customised image with https://github.com/openhab/openhab-docker as a starting point.
I added postfix and bsd-mailx into print_basepackages() of the update.sh script.
The postfix config was changed, the hostname in mail.cfg points to localhost and that the docker container was restarted. This is the same setup as on the VM before.
A few questions came up:
- how to put the custom postfix config already into the docker image during built? This would avoid changing
/etc/postfix/main.cf on the running container and restart it after a fresh build
- Connecting to knxd works with the -net=host option but not with --publish 3671:3671
If multiple instances of openhab might run I guess the publish option is needed
- I needed to add “service postfix start” to entrypoint_debian.sh, is that the recommended way?
- You would have to add it to the Dockerfile to copy the config into the image during the build.
Alternatively, you can and probably should just mount your custom file as a volume. You can mount single files in addition to folders using the --volume flag.
I don’t know anything about KNX so I can’t answer about that. But I can say that OH is not really designed to have multiple instances running on the same machine at the same time. And there are a bunch of other ports that would need to be moved around to make it work. Finally, if port 3671 is for the knxd then publishing that port on the Docker container is backwards. The container needs to be able to access that port, not accept connections on that port. What might be the problem is when you run without --net=host that your container has a different IP address from your host machine so you may need to use the IP address of your host if you are using localhost in the binding config.
Well, the proper way would be to run postfix in a separate container and connect your containers with a custom network configuration. Containers are really intended to only run one service at a time. That is one of the distinctions between containers and VMs. I know it is possible to run multiple services inside a container but I don’t know how that is done. I’d say to try it and see what happens.
Sorry for replying to an old post.
The access wih docker exec works
docker exec -it openhab /openhab/runtime/karaf/bin/client
If i want to use Visual studio to access the karaf console i cant.
Cos the ssh access does not work ether
ssh openhab@<IPAdress> -p 8101
Iam using Docker in Bridge mode.
Any solution on this?
You have to change the karaf console config to allow connections from addresses other than localhost. https://docs.openhab.org/administration/console.html#bind-console-to-all-interfaces
Thanks a lot!
you are right, having a separate container for postfix is the more elegant solution.
Thank you very much Now i just gonna get my Tellstick working
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?
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.
--device option to docker run, e.g.
--device=/dev/ttyUSB0 as described in the readme for the image on dockerhub and github.
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.
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.
Found it! its /dev/ttyACM0
How do I automatically add the z stick whilst creating the docker openhab container?
I already told you.
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
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?
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.
I moved my initial post to a separate topic per @rlkoshak recommendation.
I recommend posting this as a separate tutorial so it is seen by more people and easier to find.