-
-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Dockerfile and update on Readme #1
Conversation
# Expose volume with configuration and userdata dir | ||
VOLUME /config /userdata | ||
EXPOSE 8080 8443 5555 | ||
CMD dockerize -stdout ${APPDIR}/userdata/logs/openhab.log ${APPDIR}/start.sh server |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might make sense to have $DEBUG Environment variable to start with debug instead os server
Thanks for making a start here! I will leave it to the Docker experts to review and merge the PRs. |
ad44c14
to
2257afd
Compare
@christianwaite Would you mind taking a look at it? From what i saw in your repo it should be quite similar in behavior with yours, except that I did use ubuntu:trusty instead of phusion/baseimage. The reason for that is that it would improve portability to arm architecture since one would only need to split the architecture-specifics into it's own Dockerfile (i couldn't find baseimage for arm). On the other hand I have no idea if Java is doing proper reaping as PID 1 or if there are any zombies at all, which I guess has been the reason for pusion/baseimage at first :) I have it running on my server with this docker-compose.yml since a few days and for me it seems to work properly. I would really love to get this going as it would improve updating openhab drastically, since dockerhub's autobuilds are only triggered on pushes to the current repo (only updates on the Dockerfile in this case), while creating it as a downstream job of the openhab-distro would be almost instantaneous. |
@christianwaite, @tdeckers, @WetwareLabs & @umiddelb, I just want to make you aware of this repo/PR. It would be wonderful if one of you could have a look and comment a "lgtm" here. |
Hello! I might have found a solution to create automated arm builds with https://resin.io/blog/building-arm-containers-on-any-x86-machine-even-dockerhub/ Cheers |
Hm, as looking to this PR from an ARM perspective:
I need to check to which extend this will break/run on ARM as well. If there are platform specific dependencies inside, dockerize should be better established as a Docker image (like baseimage-docker). Why are you installing Java 8 inside the Dockerfile instead of picking one of the existing Java 8 Docker images? This might add more flexibility, e.g. switching to OpenJDK and would follow the 'segregation of concerns' principle.
You might get in touch with @DieterReuter or @StefanScherer from the @hypriot team. They found a smart solution to build/run ARM Docker images with Travis CI automatically. |
Hi @umiddelb !
Cheers |
Ok. I updated the PR now with all different versions. I only tested the openhab:offline for x86 since I do not have a docker installation on arm, maybe someone can test this please. For the setup of automated builds:
In the cloudbees instance you could set up a curl trigger to promote a successful build to a docker image:
Of course the current PR contains my repos for testing in the FROM field, but I would happily change these and squash the commits if you like it. |
I noticed a problem when the volumes are mounted on the host (as I described in the README) that the /openhab/userdata and /openhab/conf directory will be empty. This can be resolved through an entrypoint script which should check whether it's empty and copies the files over. I will update the PR in the next hours. I'm also thinking about removing dockerize as it is only used for printing the logfile to stdout (which is supposed to be docker standard), while it could of course be used as well for waiting on a mysql database for instance. But I am unsure to which standard we should adhere, Dockers (stdout, would need reconfiguration of Karaf) or keep it in openhab's way (logging to /openhab/userdata/logs? |
I'm finding it hard to find time to look into this, so I'll leave it to you guys. I'll test when I can. |
Just an idea: For debian, we won't use |
Moin,
Cheers |
|
I created a Jenkins Matrixbuild using the build-args method and it seems work quite well. The gist of the config can be found here. @kaikreuzer is it ok for you to go the openJDK path? We could then use the official java image (openjdk-8) for x86 One more thing that came to my mind: Cheers |
I am aware of the license problems with the OracleJDK and I don't have a good solution. The issue is that I have seen quite some problems when using openHAB on OpenJDK - especially on ARM (like the RaspPi), the OpenJDK is terribly slow and almost unusable for openHAB. So in general, our regular advice is to use OracleJDK instead. Now for the docker images, the problem exists only if we offer pre-build containers for download, right? I wonder if we can use OpenJDK in the pre-built containers, while still also offering docker files with OracleJDK, which people then have to build themselves locally (as this seems to be a pretty normal way of doing it as well, right?). What do you think? |
Hey. I tried out your docker image cyberkov, but it's not working under Unraid. |
It depends on the dockerhub's terms & conditions. The Docker image containing the OracleJDK binaries is made available for download at the dockerhub repository. So dockerhub might be hold liable in the first run, but then dockerhub's T&C apply. The best way to handle this issue is to build the OpenHAB image on top of an existing Java image provided by someone else (and there are some). Docker itself provides OpenJDK library images only and even Oracle as well. I'm afraid the Docker Oracle JDK image has to be built from source by any individual. |
Yes, I agree. So for the start, we should probably let go the idea of Docker hub and only provide the container description (using Oracle JDK). Is this ok for you all? What is the status of this PR then in this light? |
There is a common way to install Oracle 8 JDK inside a Docker container. I'm using a different base image (derived from Ubuntu Core) which makes it necessary to install |
I sent an email to FSF Europe in the hope they may be able to help us in this matter :) |
As stated on the Oracle-docker issue, there is hardly a chance to be able to re-distribute OracleJDK for ARM (and that is really the one that matters to us most, right?), because some more strict T&Cs apply there (the user actually has to confirm that he uses it only for development & eval purposes). So I am not sure that it will bring much to follow up on the legal side - but please let us know, what comes back from the FSF! @cyberkov Are you meanwhile ok to create the docker file with JDK installation as @umiddelb describes? @umiddelb Is there anything specific that one needs to consider in order to make the Docker file also work on Snappy Ubuntu Core? Do you know? |
No, the only prerequisite is the Docker daemon itself (and a Docker enabled Linux kernel). You can use your preferred Linux distribution as host environment (btw. Arch comes with excellent Docker support). AFAIK Snappy Ubuntu Core should work as well, but I haven't tried it yet. |
Hi! Sorry I've been busy the last days with my dayjob. I wanted to make sure we are on the same page as the thing with the Dockerfiles came up:
So to achieve these two things (accessibility of the Dockerfile and ready-made images, one would need to go through dockerhub's autobuild feature or provide a clean documentation in the Readme from where this image came from. In both cases building the image means we can assume that the building docker daemon (cloudbees or dockerhub's autobuild) is going to run on x86 architecture and needs to be able to run the given arch in an emulated environment ("apt-get install", "unzip" etc) or we are going to have a buildfarm of docker daemons somewhere for each arch in someones basement.
For all other architectures than x86 I will try to get something with qemu going (as is now with the arm image) but I cannot test it which makes me more or less blind if this is going to work :( On the other hand I found some things that I want to put into the container and hope they might be useful:
I hope i will have something in the next days and keep you posted :) |
Thanks for your efforts! |
@umiddelb Thank you! :D I cannot describe how happy I am! In the last few days I learned A LOT about crosscompiling and Linux, despite I've been using it since 2008 :) Especially your first post about hypriots approach on travis pointed me towards the right direction. By moving Java to the main Dockerfile I didn't see a reason for a baseimage at all (removed dockerize) and this brought the image down to 1 Dockerfile for all architectures and Flavors :) I also started on the serverspec tests and they do work quite well. Still there's more to be done like checking on the different ways to invoke the image (with and without userdata as hostvolume, data-volume container pattern, demo, debugmode and so on...). Unfortunately the documentation on docker in combination with serverspec is very sparse. When I finalized the travis config, including the uploading to dockerhub, I will update the PR to reflect my changes. Cheers |
Hi Hannes @cyberkov, Cheers, |
OK, and this: |
Hello @kaikreuzer! Any luck changing the account type? I saw that the account still exists :) |
Yes, support has answered me today and told me that openhab was actually already an organization, but I didn't have any rights on it. It was Thomas who created it and he added me as an admin today - and I have just added @cyberkov and @cniweb as well, you should have received an according notification. |
Great, I create the Repo: |
77a4ec8
to
6e53241
Compare
Hi! @cniweb @kaikreuzer Next step would be the job on cloudbees. You need to set the TRAVIS_TOKEN and as an environment variable and execute shell build step with make trigger. Cheers Hannes |
Thanks! Before merging, could you please squash the 3 commits into a single one and sign-off the commit? |
2921a32
to
3d74561
Compare
It is not that much an "Eclipse procedure" than rather a mechanism that I suggest to keep the repository clean from an IP perspective. We should make sure that code that ends up in the repo is clearly contributed under the EPL by all copyright holders (=authors).
It depends on what "based on" exactly means. If you took his Makefile as an example to write your own version for our purposes, then all is fine. If you have copied some of his work (which is under his copyright), we would need his approval that he is fine to contribute it here unter the EPL as well. |
3d74561
to
67f56ac
Compare
Also-by: Christian Häussler <c-n-i@web.de> (github: cniweb) Also-by: Manfred Touron <m@42.am> (github: moul) Signed-off-by: Hannes Schaller <admin@cyberkov.at> (github: cyberkov)
67f56ac
to
da8aedc
Compare
Hello! |
Copying code from @moul and adding him as Also-By means that you must have made sure that he agrees to contribute this code under the EPL. There is no license given for the Makefile in his own repo, so we will need an explicit confirmation from him. If he reads this and would comment on this issue that he is fine with it, that would be the simplest solution. |
I sent him a mail as well :) Would be great to have his ok. |
License added :) have fun |
Many thanks, @moul. As we are using EPL and not MIT in this repo, could you just briefly confirm that this is ok for you (i.e. that you contribute this file under the EPL to this repo by being a co-author of this PR)? |
I confirm this is OK for me, I choose MIT because it was listed as compatible with EPL on the EPL website :) I'm not sure if this message is enough or if I need to commit something somewhere ? |
This is enough, thanks again! |
Hello @cniweb / @kaikreuzer! Cheers |
@kaikreuzer thanks for adding :) I reconfigured Travis and restarted the one erroneous build. Cheers |
@cyberkov Just granted you access to the Cloudbees Jenkins as well - so feel free to set up a new job there! |
@kaikreuzer thank you! I created the job and subscribed it as a downstream to openHAB-Distribution. Cheers Hannes |
Absolutely - imho small fixes can be merged by the committer himself. For other changes we should stick to a "lgtm" comment from someone else, just to follow the 4-eye pronciple. |
@cyberkov please give me a short ping, if there is anything to be tested by myself on armhf or aarch64. I'm considering to open my 'lab' environment for external access, in order to run necessary tests automatically, but I need to learn more about OpwnWRT first ;) |
* Update README to Version 2.1.0 * Add Version 2.1.0 and 2.2.0-snapshot * Update entrypoint.sh (#94) (#1) * Echo actual `NEW_USER_ID`, instead of hardcoded/default id=9001. * Remove Version 2.2.0-snapshot and add 2.1.0-snapshot * Fix sudo enabled environment for travis * RUN chmod +x on entrypoint.sh within Dockerfile to fix permission issue * Add version 2.2.0-snapshot * Add MAINTAINER section * Docker image based on Alpine Linux #99 * Add alpine as base image and new architecture * Add alpine as base image in TravisCI build * Fix CMD in Dockerfiles * Openhab GROUP_ID can now be set via variable at container creation time * Fix #104 * Add shadow package for alpine * Change entrypoint.sh * Fix entrypoint.sh for alpine and version 1.8.3 * Add generated entrypoint.sh * Update readme for new alpine docker images
* Switch to back to alpine v3.6 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: @cniweb) Signed-off-by: Christian Häussler <c-n-i@web.de> * Switch back to alpine v3.6 Signed-off-by: Christian Häussler <c-n-i@web.de> (github: @cniweb) Signed-off-by: Christian Häussler <c-n-i@web.de> * Merge pull request #1 from openhab/master Update from master * Merge remote-tracking branch 'refs/remotes/openhab/master' * Add warning for Alpine image users Fix #130 Signed-off-by: Christian Häussler <c-n-i@web.de>
Hi!
I started the Dockerfile based on the ubuntu image with java8 (as suggested in the forum).
The exposed volumes are /config and /userdata.
Please let me know if we can improve it anyhow.
Cheers
Hannes