hardillb / TRADFRI2MQTT

MQTT Bridge for IKEA TRÅDFRI Light Gateway
https://www.hardill.me.uk/wordpress/2017/04/06/fist-pass-tradfri-mqtt-bridge/
Apache License 2.0
81 stars 12 forks source link

Added support for Docker. #6

Closed adec closed 7 years ago

adec commented 7 years ago

Added Dockerfile to create image based on openjdk:8-jre-alpine. Amended README.md to include details on how to build and run the docker image.

hardillb commented 7 years ago

Thanks for this

Any chance of having a look at converting it to the maven:alpine-onbuild docker parent container, then the compile step gets done as part of the docker build? https://hub.docker.com/_/maven/

adec commented 7 years ago

No problem. I had considered it but originally decided against it as I assumed the image will be bigger. However in reality the difference will probably be negligible and worth it for ease of use.

adec commented 7 years ago

You may want to hold off merging this request at the moment. I reworked the dockerfile as requested and tested the basic build. However I wasn't able to test the full functionality. I'll test it out more fully this evening and give you the nod when it's done.

hardillb commented 7 years ago

Cool, thanks for the heads up.

hardillb commented 7 years ago

I'll have a look at the maven doc to see if I can get it to generate a shell script with the target jar file name built in so we don't have to keep bumping the version in the Dockerfile each time we do a release

adec commented 7 years ago

If I've committed the right version of the Dockerfile I've fixed that one. I was struggling with the same thing earlier.

I was originally going to use the Exec Maven plugin but was struggling with passing additional parameters.

Instead I found a solution by using the CLASSPATH to search for the Main method so I don't have to reference the Jar file directly.

adec commented 7 years ago

Okay I committed the wrong Dockerfile. I'll update it again.

adec commented 7 years ago

Just finished testing against my Tradfri gateway & MQTT broker - all good. ;-)