Running Dump1090 Mutability in Docker container


#1

Hi,

I am running Dump1090 Mutability in Docker containers. This way I am able to run multiple Dump1090 instances on the same X86 Linux host. It can be useful for testing.
It is also possible to build a Dump1090 container image on one host and run it on other Linux hosts even in the cloud, without the need of repackaging the image. It runs every where!
But my main goal is to make dump1090 scaleable as a real cloud application and being able to serve an extreem amount of users. Running an dynamic amount of dump1090 containers depending on the amount of current users…

Not familiar with Docker containers jet? Containers look like VM’s (virtual machines on VMware, HyperV, Xen, KVM, VirtualBox, etc), but they are much more fast and use less resources. They all share the same kernel. Unlike VM’s on a hypervisor, which all have their own kernel and therefor use much more resources. It is not visualization by a hypervisor, but by isolation of resources. Google and Twitter are using containers for many year and recently the hole world is jumping onto containers. Check http://www.docker.com and https://www.opencontainers.org. And this video: Getting Started with Docker

I have build a X86 container image with Dump1090-Mutability V1.15 and my own heatmap and radarview functionality. The image is available on Docker Hub: https://hub.docker.com/r/tedsluis/dump1090-mutability
If you have already installed Docker on your system (it is available for almost every Linux Distro and for Windows and IOS, check: https://docs.docker.com/engine/installation) you can download, run and use my dump1090 GUI with a single command. But then you get my personal settings and you will see planes in the GUI that are spotted by my antenna :wink:
With a little more effort you can build your own Docker container image with our own Dump1090 version. Use my Dockerfile (https://github.com/tedsluis/docker-dump1090) as a starting point and make some changes. Add you own config files and set our own BEAST format source.

This image doesn’t use a RTL SDR receiver with a antenna to gather flight data. Instead it uses an other dump1090 instance that I have running in the Google cloud. It is collecting BEAST format data from that Dump1090 remote source. I use netcat to copy the BEAST data from the remote Dump1090/port 30005 to port 30104 of the Dump1090 in the container. If you use my container you will get my BEAST data. However, I have made it possible to change the BEAST source IP address. SO you can point it to you own Dump1090 receiver. You can find the instructions on Github and DockerHub.

If you are still not convinced that this is cool and easy to do then check my video, where I show all the steps of building and running a dump1090 docker container:
https://github.com/tedsluis/docker-dump1090/raw/master/img/dump1090-build.png

I hope you enough it!

Ted


Raspberry Pi + Docker = From blank SD to feeding in 15 mins
Changing the Console font
#2

Why do you want to run an additional dump1090 that’s fed from a satellite site that has the real dongle?


#3

cool idea ted - could be nice to gather data from different sites instead using virtualradarserver … wondering how this scales up.
let me know as soon as you have a plug and play ready container with objs mlat-server - that would be supercool :slight_smile:


#4

Someone else tried it here:

sysrun.io/2015/11/12/raspber … r-rtl-sdr/

And they use tedsluis dump1090 version


#5

I am not sure jet :wink: It could be a service for people on an airport waiting for their flight.
It can also be used to publish a link to our personal dump1090 in this forum. Not the one that you are running at home, but one in the cloud that can scale up when lot’s of users look at your site. And scale down as they leave…
Your site at home is only available from your locale network. It is vulnerable and you don’t want the outside world on your locale network. A container is more save. It has no SSH access and you can run it in the cloud.


#6

Yeh, there are a couple of examples of dump1090 in containers available on the internet. I don’t think they use the Mutability version.
This sysrun.io example is running Docker on a raspberry. They use hypriot (blog.hypriot.com/getting-started … rm-device/), a Debian based Docker Linux Distro for Raspberry Pi. I use this distro too, to run docker containers on Raspberry. I did build two ARM raspbian base images for it, available on DockerHub: https://hub.docker.com/u/tedsluis/

The great thing about Docker images is that you can build them on your laptop and run them everywhere: On an other laptop, on a server of in the cloud (AWS, Google, …). Images don’t have dependencies with the hardware. And they are very easy to distribute: Ones you have build an image, you can push it to the DockerHub and on an other host you can pull it and run containers from it. Yes, you can have one image and start as much containers as you like from it on the same host.

However, you can not run ARM images on a X86/AMD64 hardware or vise versa. So my X86/AMD64 dump1090-mutability Docker image won’t run on a Raspberry. And my raspbian.arm7 won’t run on a Intel or AMD laptop, server or cloud. But it is very easy to rebuild an image for an other platform. For example my dockerfile (https://github.com/tedsluis/docker-dump1090/blob/master/dockerfile) for dump1090-mutability needs probably very little or none changes to build a ARM container on a raspberry.

In summary, containers can be very easy to build, distribute and run software. I think it’s a great advantage that the packaging an application using a dockerfile is like programming the configuration.


#7

dump1090-mutability fork update
I have updated my (https://github.com/tedsluis/dump1090)) with upstream commits from https://github.com/mutability/dump1090.

docker-dump1090 update
I have also an update on how to run dump1090-mutability in a docker container:

This gives you the possibility to try any dump1090-mutability fork on X86 / ADM64 hardware.
Build a image and run from source in minutes. It is even possible to run serveral different dump1090-mutability forks simultaneous on one docker host.

If you have a host with docker, you can start docker container with dump1090-mutability by running:


$ docker run -d -h dump80 -p 8080:80 tedsluis/dump1090-mutability:v1.15_heatmaprangeview

It is that simple!
And then use your browser to view http://IPADDRESS_YOURDOCKERHOST:8080/dump1090

Live view
If you want to try my dump1090 fork with heatmap and rangeview in the Google cloud: http://130.211.110.109/dump1090/gmap.html (This dump1090 runs on a 60-day free trail that is available until September 6 2016, more info at: https://cloud.google.com/free-trial/)


#8

Hi Ted, I managed to find some time to give Docker a try. I downloaded the Hypriot image and followed your instructions but have a problem.

Searching the net for the error message suggests that Docker won’t run on a 32 bit system. I thought the Hypriot image was 32 bit?

“Hello-world” fails with the same error.


HypriotOS: pi@black-pearl in ~
$ docker run -d -h dump80 -p 8080:80 tedsluis/dump1090-mutability:v1.15_heatmaprangeview
10bb629d76aa3646cadcc5f80332175cdd471dfb6520154d5c282e7d88e6d538
Error response from daemon: Cannot start container 10bb629d76aa3646cadcc5f80332175cdd471dfb6520154d5c282e7d88e6d538: [8] System error: exec format error
HypriotOS: pi@black-pearl in ~
$



HypriotOS: pi@black-pearl in ~
$ docker images
REPOSITORY                     TAG                      IMAGE ID            CREATED             VIRTUAL SIZE
tedsluis/dump1090-mutability   v1.15_heatmaprangeview   ad9df331d729        3 days ago          526.9 MB
hypriot/rpi-swarm              latest                   039c550f6208        3 months ago        10.92 MB
hello-world                    latest                   0a6ba66e537a        4 months ago        960 B
hypriot/rpi-busybox-httpd      latest                   c7278d0bf2e2        8 months ago        2.156 MB
HypriotOS: pi@black-pearl in ~
$



$ docker -v
Docker version 1.9.0, build 76d6bc9



$ docker version
Client:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Sun Nov  8 20:32:37 UTC 2015
 OS/Arch:      linux/arm

Server:
 Version:      1.9.0
 API version:  1.21
 Go version:   go1.4.3
 Git commit:   76d6bc9
 Built:        Sun Nov  8 20:32:37 UTC 2015
 OS/Arch:      linux/arm



#9

Hi Triggers,

Thanks for trying. You are right that this 64 bit Docker image does not work on Raspberry pi with Docker Hypriot. But I have fixed that for you :wink:

X86/AMD64 Docker images:
On Github I had two dockerfiles that runs only on X86 / AMD64 hardware (64-bit) with an Intel of AMD cpu:
(my fork of v1.15 dump1090-mutability with heatmap and rangview)dockerfile
(the original v1.15 dump1090-mutability by Obj, with heatmap and rangview)dockerfile.org

I used these dockerfiles to build two corresponding X86 / AMD64 Docker images:
tedsluis/dump1090-mutability:v1.15_heatmaprangeview (my fork)
tedsluis/dump1090-mutability:v1.15 (latest version by obj)
These Docker images won’t run on 32-bit Raspberry ARM hardware.

X86/AMD64 Docker images never run on ARM and vise-versa:
The source code of dump1090-mutability (github.com/tedsluis/dump1090) can be build on both ARM (Raspberry) and X86/AMD64 (PC’s / laptops / servers with Intel and AMD cpu’s). But you need to use a slightly different dockerfile to run it on Raspberry pi (ARM), because:

Raspberry pi ARM Docker images:
I have created two new dockerfiles for raspberry pi (ARM):
(my fork of v1.15 dump1090-mutability with heatmap and rangview, ARM version)dockerfile.arm
(the original v1.15 dump1090-mutability by Obj, with heatmap and rangview, ARM version)dockerfile.org.arm

I have used these dockerfiles to build two corresponding ARM Docker images:
tedsluis/dump1090-mutability:v1.15_heatmaprangeview_arm (my fork)
tedsluis/dump1090-mutability:v1.15_arm (latest version by obj)
These Docker images will run on 32-bit Raspberry ARM hardware using the Hypriot Docker Debian Packages for Raspberry Pi.
They are now available at Docker hub so you can try them.

Install Docker on Raspberry pi
For those who don’t know this: Docker is very easy to install on Raspberry.
You can run it on the same host were you have already dump1090 and piaware running, but it can be a bit slow sometimes.
The Hypriot team has a docker package available that runs on Raspbian. It makes it able to run ARM docker images on raspberry pi.
Download it from: http://blog.hypriot.com/downloads/
Install it like this:


pi@ted1090-5:~ $ wget https://downloads.hypriot.com/docker-hypriot_1.10.2-1_armhf.deb
--2016-02-28 09:54:54--  https://downloads.hypriot.com/docker-hypriot_1.10.2-1_armhf.deb
Resolving downloads.hypriot.com (downloads.hypriot.com)... 162.159.243.125, 162.159.244.125, 2400:cb00:2048:1::a29f:f37d, ...
Connecting to downloads.hypriot.com (downloads.hypriot.com)|162.159.243.125|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6605872 (6.3M) [application/x-debian-package]
Saving to: ‘docker-hypriot_1.10.2-1_armhf.deb’

docker-hypriot_1.10.2-1_armhf.deb                    100%=======================================================================================================================>]   6.30M  4.94MB/s   in 1.3s   

2016-02-28 09:54:55 (4.94 MB/s) - ‘docker-hypriot_1.10.2-1_armhf.deb’ saved [6605872/6605872]

pi@ted1090-5:~ $ sudo dpkg -i docker-hypriot_1.10.2-1_armhf.deb
Selecting previously unselected package docker-hypriot.
(Reading database ... 132292 files and directories currently installed.)
Preparing to unpack docker-hypriot_1.10.2-1_armhf.deb ...
Unpacking docker-hypriot (1.10.2-1) ...
Setting up docker-hypriot (1.10.2-1) ...
Processing triggers for systemd (215-17+deb8u2) ...
pi@ted1090-5:~ $

Of course it is also possible to run docker containers on the Hypriot-os image for raspberry (as is shown by triggers in the previous post).

And test it like this:


pi@ted1090-5:~ $ sudo docker version
Client:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.4.3
 Git commit:   c3959b1
 Built:        Wed Feb 24 09:51:38 2016
 OS/Arch:      linux/arm

Server:
 Version:      1.10.2
 API version:  1.22
 Go version:   go1.4.3
 Git commit:   c3959b1
 Built:        Wed Feb 24 09:51:38 2016
 OS/Arch:      linux/arm
pi@ted1090-5:~ $ 

Run a dump1090 on Raspberry
Run my dump1090-mutability fork with heatmap and rangview:


pi@ted1090-5:~ $ sudo docker run -d -h dump80 -p 8080:80 tedsluis/dump1090-mutability:v1.15_heatmaprangeview_arm

Try it in your browser:http://<IP_YOUR_RASPBERRY>:8080/dump1090

Now you are able to run an other dump1090 container on the same host (for example obj original dump version):


pi@ted1090-5:~ $ sudo docker run -d -h dump81 -p 8081:80 tedsluis/dump1090-mutability:v1.15_arm

Try it in your browser:http://<IP_YOUR_RASPBERRY>:8081/dump1090

Be sure that you use a different host name (-h ) and ‘outside port number’ (-p ) for every container!

More info at:
https://github.com/tedsluis/docker-dump1090
https://hub.docker.com/r/tedsluis/dump1090-mutability/

Running dump1090 in docker containers on raspberry can have some advantages, for example in the case you want try a new version or in case you want to run several versions at the same time. But you can not run tens or hundreds containers on one raspberry. On hardware with more memory, more and faster cpu cores and faster block-io you (like X68_64/AMD64 hardware with Intel or AMD cpu’s or on ARM boards like Orange pi 2plus) you can many containers. One dump1090 takes about 20MB memory and 2% cpu (from one of the available cores).

I hope this helps you.

Ted Sluis


#10

Hi Ted,
Many thanks for making your Dockerfiles available. I did use one of them to build my own image and it built without a problem. I’ll study what you have done and see if I can make appropriate changes so I get my planes rather than yours.

I’ll be back :laughing: