-
Notifications
You must be signed in to change notification settings - Fork 67
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 for Recorder #20
Conversation
The problem with the current solution is that it provide a monolytic multiprogramm docker container. However the idiom of docker is to have one service per docker container. If multiple services are needed multiple docker container should be used. Docker-compose makes this easily possible. Another isse is that the container automatically creates certificates and sets up encryption using a script. Also this violates docker idioms, because certificate handling can be done using specific containers like letsencrypt. It further makes it hard to include this image into an existing and possible complex infastructure. A further goal of mine would be to generate a Hassio addon for the homeassistant project from this. The current dockerfile makes this kind of hard. What I did: - Slimmed down the container to about 10MB by using alpine as a base - Added a `docker-compose.yml` file that shows how to build and run the container - Added a `docker-compose-mqtt.yml` file to show how a mqtt broker can be added. This shows how a plug and play solution using docker could look like. - Changed the docker image label to owntracks/recorder - Added documentation on how to use and configure the image - Simple travis file for possible automatic building in the near future - Removed automatic certificate handling Instead provide `config` volume to allow configuration. - Removed arm32v7 build should be readded later but I dont have a setup for testing right now What might be added at some point: - Example with nginx reverse proxy - Example with letsencrypt certificate This could also be an example for a complete plug and play solution. Proxy, SSl, MQTT and Recorder. - Default resolv.conf file with all default options and documentation - Upload to docker hub - Change name to owntracks/recorder - Some more examples for eclipse mosquitto
Thank you, @deisi, for this work. What you write sounds sensible to me. FYI, the reason it was originally a multi-system container (recorder + mosquitto) was simply my ignorance. I have since learned (also from you) that it was a bad idea. As such, I greatly appreciate these changes. I also approve of the simplification in removing certificate creation; this should, indeed, be left to "third party", i.e. Let's Encrypt & co. @juzam Could you please, as our resident docker contributor :-), look at this and comment? |
:-) |
I'll give a proper look as soon as possible :) |
@deisi I'm trying this now, and get a linker error for
I fixed with index 687325c..2996a59 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -13,7 +13,7 @@ RUN apk add --no-cache --virtual .build-deps \
curl-dev libconfig-dev make \
gcc musl-dev mosquitto-dev wget \
&& apk add --no-cache \
- libcurl libconfig-dev mosquitto-dev lmdb-dev libsodium-dev lua5.2-dev \
+ libcurl libconfig-dev mosquitto-dev lmdb-dev libsodium-dev lua5.2-dev openssl-dev \
&& mkdir -p /usr/local/source \
&& cd /usr/local/source \
&& wget https://github.com/owntracks/recorder/archive/$VERSION.tar.gz \ |
For the rest, it works like a charm, @deisi! |
Merged. Thank you very much! |
The problem with the current solution is that it provide a monolytic
multiprogramm docker container. However the idiom of docker is to
have one service per docker container. If multiple services are
needed multiple docker container should be used. Docker-compose
makes this easily possible.
Another isse is that the container automatically creates certificates
and sets up encryption using a script. Also this violates docker
idioms, because certificate handling can be done using specific
containers like letsencrypt. It further makes it hard to include this
image into an existing and possible complex infastructure.
A further goal of mine would be to generate a Hassio addon for the
homeassistant project from this. The current dockerfile makes this
kind of hard.
What I did:
docker-compose.yml
file that shows how to build and runthe container
docker-compose-mqtt.yml
file to show how a mqtt brokercan be added. This shows how a plug and play solution using
docker could look like.
future
Instead provide
config
volume to allow configuration.should be readded later but I dont have a setup for testing right
now
What might be added at some point:
This could also be an example for a complete plug and play
solution. Proxy, SSl, MQTT and Recorder.