I've just finished building a working set of docker containers for indiserver. This includes both x86 and Raspbian images. I've tested it on both platforms without any problems.
For those of you who haven't used Docker before, it's a really nice way to encapsulate and deploy a service along with all of its dependencies. For example, to run the indiserver with all the simulators with a stock RPI you just need to run the following command (no downloading or installing needed other than installing docker-engine)
docker run --rm -ti seanhoughton/indiserver:1.3.1
When the process is stopped (with ctrl-c in this case) the container is removed and your system is left in the same state as before you started it. No bit-rot, no dependency hell, etc. The image is cached locally so future runs start almost instantly. If you want to try a different version just change the version tag of the image and start it.
Thanks for sharing. I just tested it on a fresh installed Ubunutu 16.04 Docker host and it works fine. For a quick (newbie) test I added --net=host to the command line to expose the INDI port. May be this helps other readers who, as I did, start testing before reading the chapter "Running the containers"
That's very useful and unavoidable for the future. Thanks for this!
I believe that KStars and Ekos are great candidates for a docker (or similar container) as well. This will become more and more important for users of tablets with native linux (e.g. ubuntu) system onboard.
The following user(s) said Thank You: Jasem Mutlaq
I would suggest switching to the explicit port mappings with -p 7624:7624 instead of using the host network. Whitelisting ports reduces the "surface area" of your container and has some other benefits if you put more things into containers. Also, if you run each driver in its own container (something I'm prototyping now) you'll get port conflicts on the host network.
I'll take another stab at the readme. The first pass is kind of an information dump rather than a flowing doc.
Hi Sean,
great contribution! Inspired by your first version I was also woking on a docker container image for the raspberrypi. There is a project "Hypriot" (blog.hypriot.com/) which provides SD card images for the raspberry with a docker framework already installed. I tried it and it works perfectly. There seems to be no measurable overhead of the container technology , it runs even on a raspberry 1. My current idea is to install the indiwebmanager on top of your container. It is then possible to start the docker container as a systemd service so that you dont have to know about starting containers with dockers at all ...
Afaik, you can add a version tag to your docker image. The cool thing is, that due to container isolation, you can run different versions of the INDI library on the same hardware. Special care has to be taken if you change the container, e.g. changing the config file, then you have to commit those changes in order to ensure that the changes don't get lost. It works a bit like git ... Though docker use special Linux kernel features (namespaces), you can run docker on Windows (>= 10) as well. They use the new embedded Linux virtualization on Windows 10 (however currently limited on windows 10 pro...). When windows supports Ubuntu > 14.04, this could be an intereting option to run native indiserver on windws ... just a thought.
I'm still working through the best way to deal with keeping versions up to date. Currently I'm using dockerhub to automatically build the x86 containers. The "latest" tag is built with the "master" branch of the dockerfiles which use version=* while the 1.3.1 tag is built with the 1.3.1 branch which has version=1.3.1. dockerhub will rebuild the images anytime a change is committed to the inid-docker repo
Unfortunately dockerhub doesn't yet have automated builds for RPI images so I have to build/push them manually. I'm investigating CI server options for automating it.
I'll take a look at containers for kstars, but it might be more confusing for users due to file system isolation.