Skip to content
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

docker containers for the various parts #4

Open
bnordgren opened this issue Jan 3, 2017 · 9 comments
Open

docker containers for the various parts #4

bnordgren opened this issue Jan 3, 2017 · 9 comments

Comments

@bnordgren
Copy link
Owner

bnordgren commented Jan 3, 2017

  • tile server
  • web application
  • aprsd
  • direwolf
  • gpsd
@bnordgren
Copy link
Owner Author

I now have a docker container for arm64 and armhf which contains all three functional units of software. Many of the important configuration files have been exposed in the docker build directory, and are copied in to the image when it is built.

Separately, I also have a container with just the mapcache (tile server.) The tile server has been running on my Pi Zero and seems quite capable of seeding the tile cache.

Making a container image for just the aprsd part should also be pretty easy.

Isolating the webapp will be tricky because I'm using the supplied binary packages, and the webapp depends on the other two pieces of software. May need to repackage or just install from source.

@bnordgren
Copy link
Owner Author

Mental note: currently (locally) my polaric images are tagged as "polaric-webapp-xxxxx" where xxxxx is the architecture. Before publishing on dockerhub, make sure to rename them to polaric-server-xxxxx.

@bnordgren
Copy link
Owner Author

Note that the docker container running jsvc (e.g., polaric-aprsd) needs to have extra capabilities allowed. For my all-in-one container, mistakenly named "webapp" as noted above, this is:

docker run --name polaric -ti -p 80:80 --cap-add DAC_READ_SEARCH polaric-webapp-arm64 bash

@bnordgren
Copy link
Owner Author

bnordgren commented Jan 7, 2017

getting sound into the direwolf container was not obvious. long story short:

docker run -ti --net polaric_net  --name direwolf --rm --device /dev/snd:/dev/snd   direwolf-arm64

@bnordgren
Copy link
Owner Author

docker run --name polaric --cap-add DAC_READ_SEARCH -d -p 80:80 --net aprs-box -v /home/alarm/mapdata:/var/cache/mapcache polaric-server-arm64

@bnordgren
Copy link
Owner Author

Put the following in /etc/systemd/system/docker-polaric_server.service to make the container named "polaric" start automatically and restart if it ever dies:

[Unit]
Description=Polaric server container
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker start -a polaric
ExecStop=/usr/bin/docker stop -t 2 polaric

[Install]
WantedBy=default.target

You have to have a container named polaric, though.

@bnordgren
Copy link
Owner Author

The docker container requires read/write access to the /sys/class/gpio tree to make PTT work.

docker run -ti --device /sys/class/gpio:/sys/class/gpio direwolf-arm64

@bnordgren
Copy link
Owner Author

The docker container requires read/write access to the /sys/class/gpio and /sys/devices/platform trees to make PTT work. Combined with the access to the sound devices (above):

docker run -ti -v /sys/class/gpio:/sys/class/gpio -v /sys/devices/platform:/sys/devices/platform --device /dev/snd:/dev/snd direwolf-arm64

@bnordgren
Copy link
Owner Author

Cleaning up the docker build process a little bit, I'm coming to the following revelations:

  • It will never be as simple as a "docker pull" because there is too much configuration.
  • It can be as simple as "git clone && configure && docker build"
  • I can use a single Dockerfile for multiple platforms. The primary difference building for an x86_64 desktop, ARM 32 bit (Pi, BeagleBone, etc) and ARM 64 bit (Odroid C2) is the FROM line. Everything else is the same.

The main problem I have so far is that the debian jessie build for 64 bit intel/amd architectures stalls out while installing a dependency, whereas debian jessie for aarch64 works just fine. Ubuntu 16.04 for intel/amd works just fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant