Dockerfile: Install Pisound

I am building a swarm of Rpi/Pisound streaming hydrophones at
live . orcasound . net. I want to use Balena to manage them.

I wonder if anyone had been able to install Pisound on a Rpi via a Dockerfile.

My Dockerfile sets USER root and WORKDIR /root and then installs curl
Then it tries to install pisound via curl as blokas recommends:
This reports error: SSL certificate problem: unable to get
[main] local issuer certificate

When installing directly on the Rpi, no certificate issues arise.

Any thoughts?
Val Veirs
San Juan Island, WA

Minimal Dockerfile:
FROM arm32v7/debian:buster-slim
MAINTAINER Orcasound orcanode-devs@orcasound.net

Upgrade OS

RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::=“–force-confold”

Set default command to bash as a placeholder

CMD [“/bin/bash”]

Make sure we’re the root user

USER root
WORKDIR /root

Install required libraries

RUN apt-get update && apt-get install -y --no-install-recommends
curl
RUN curl https://blokas.io/pisound/install.sh | sh
RUN apt-get update
RUN arecord -l

Can you post the entire error output you get?

Here is the full result of pushing this Dockerfile: (replacing . by dot and http by ++++ to reduce number of links below 3
val@pop-os:~/balenaFiles/bal-1/pisound$ balena push val-one

╭────────────────────────────────────────────────────────────────────╮
│ │
│ Update available 16 dot 5 dot 2 → 16 dot 6 dot 6 │
│ ++++s://github dot com/balena-io/balena-cli/blob/master/INSTALL dot md │
│ │
╰────────────────────────────────────────────────────────────────────╯

[Info] Starting build for val-one, user vveirs
[Info] Dashboard link: ++++s://dashboard dot balena-cloud dot com/apps/2054214/devices
[Info] Building on 3c65b7a
[Info] Pulling previous images for caching purposes dot dot dot
[Success] Successfully pulled cache images
[main] Step 1/10 : FROM arm32v7/debian:buster-slim
[main] —> 984506579781
[main] Step 2/10 : MAINTAINER Orcasound <orcanode-devs@orcasound dot net>
[main] Using cache
[main] —> fec0110ef770
[main] Step 3/10 : RUN apt-get update && apt-get upgrade -y -o Dpkg::Options::=“–force-confold”
[main] Using cache
[main] —> c8de4aa30a33
[main] Step 4/10 : CMD [“/bin/bash”]
[main] Using cache
[main] —> be1ab3b5151a
[main] Step 5/10 : USER root
[main] Using cache
[main] —> 0ce4358864ef
[main] Step 6/10 : WORKDIR /root
[main] Using cache
[main] —> 112f34387381
[main] Step 7/10 : RUN apt-get update && apt-get install -y --no-install-recommends curl
[main] Using cache
[main] —> a6c0034cc26f
[main] Step 8/10 : RUN curl ++++s://blokas dot io/pisound/install dot sh | sh
[main] —> Running in e74a0110db24
[main] % Total % Received % Xferd Average Speed Time Time Time Current
[main]
[main] Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
0 0 0 0 0 0 0 0 --:-
[main] -:-- --:–:-- --:–:-- 0
[main]
[main] curl: (60) SSL certificate problem
[main] : unable to get local issuer certificate
[main] More details here: ++++s://curl dot haxx dot se/docs/sslcerts dot html
[main] curl failed to verify the legitimacy of the server and therefore could not
[main] establish a secure connection to it dot To learn more about this situation and
[main] how to fix it, please visit the web page mentioned above dot
[main]
[main] Removing intermediate container e74a0110db24
[main] —> 3b6daf07a25f
[main] Step 9/10 : RUN apt-get update
[main] —> Running in db7d536a42a8
[main] Hit:1 ++++://deb dot debian dot org/debian buster InRelease
[main] Get:2 ++++://deb dot debian dot org/debian-security buster/updates InRelease [34 dot 8 kB]
[main] Hit:3 ++++://deb dot debian dot org/debian buster-updates InRelease
[main] Get:4 ++++://deb dot debian dot org/debian-security buster/updates/main armhf Packages [526 kB]
[main] Fetched 560 kB in 1s (920 kB/s)
[main] Reading package lists dot dot dot
[main] Removing intermediate container db7d536a42a8
[main] —> 1e24a0a3c8f5
[main] Step 10/10 : RUN arecord -l
[main] —> Running in 826648f51ff5
[main] /bin/sh: 1: arecord: not found
[main]
[main] Removing intermediate container 826648f51ff5
[main] The command ‘/bin/sh -c arecord -l’ returned a non-zero code: 127
[Info] Uploading images
[Success] Successfully uploaded images
[Error] Some services failed to build:
[Error] Service: main
[Error] Error: The command ‘/bin/sh -c arecord -l’ returned a non-zero code: 127
[Info] Built on 3c65b7a
[Error] Not deploying release dot
Remote build failed

Update: if I add -k --insecure to the curl line, I get past the certificate problem and run into sudo problems. When installing pisound via this install.sh directly in a Rpi terminal window, the sudo is accepted but here, building an image for the Rpi, it seems that sudo needs to be responded to somehow.

[main] Step 8/10 : RUN curl https://blokas.io/pisound/install.sh -k --insecure | sh
[main] —> Running in 7b8a25e04b64
[main] % Total % Received % Xferd Average Speed Time Time Time Current
[main] Dload Upload Total Spent Lef
[main] t Speed
0 0 0 0 0 0 0 0 --:–:-- --:–:-- --:–:-- 0
100 1271 100 1271 0 0 2875 0 --:-
[main] -:-- --:–:-- --:–:-- 2882
[main]
[main] Importing Blokas GPG public key…
[main] sh: 18: sudo: not found
[main]

I have simplified and brought all the code into the Dockerfile and debugged a bit and now have I hope just one small issue.
I put my Dockerfile and a data dump up on github at:
(GitHub - orcasound/minBalenaPisound)

Please take a look as see if there is a fix to the error after line 315:
316 main] Step 16/18 : RUN apt-get -y install pisound
[main] —> Running in af87d9bd5327
[main] Reading package lists…
[main] Building dependency tree…
[main] Reading state information…
[main] Some packages could not be installed. This may mean that you have
[main] requested an impossible situation or if you are using the unstable
[main] distribution that some required packages have not yet been created
[main] or been moved out of Incoming.
[main] The following information may help to resolve the situation:
[main] The following packages have unmet dependencies:
[main] pisound : Depends: pisound-btn (>= 1.13-1) but it is not going to be installed
[main] Depends: pisound-ctl (>= 1.03-1) but it is not going to be installed
[main] E: Unable to correct problems, you have held broken packages.

Thank you for helping get pisound to install under Docker

Val Veirs
www.live.orcasound.net – streaming Rpi’s using pisound board

I have simplified and brought all the code into the Dockerfile and debugged a bit and now have I hope just one small issue.
I put my Dockerfile and a data dump up on github at:
(GitHub - orcasound/minBalenaPisound)

Please take a look as see if there is a fix to the error after line 315:
316 main] Step 16/18 : RUN apt-get -y install pisound
[main] —> Running in af87d9bd5327
[main] Reading package lists…
[main] Building dependency tree…
[main] Reading state information…
[main] Some packages could not be installed. This may mean that you have
[main] requested an impossible situation or if you are using the unstable
[main] distribution that some required packages have not yet been created
[main] or been moved out of Incoming.
[main] The following information may help to resolve the situation:
[main] The following packages have unmet dependencies:
[main] pisound : Depends: pisound-btn (>= 1.13-1) but it is not going to be installed
[main] Depends: pisound-ctl (>= 1.03-1) but it is not going to be installed
[main] E: Unable to correct problems, you have held broken packages.

I thank whoever can help get pisound to install under Docker

Val Veirs
www.live.orcasound.net – streaming Rpi’s using pisound board

The pisound-btn, pisound-ctl and the rest of the related software is not necessary for recording and playing audio via Pisound, they’re needed if you need the button functionality or use the Android Pisound App.

I haven’t ever tried getting audio to work with Docker, it may not be trivial. I’ve found this article: Docker Container Audio - Lei Mao's Log Book the key elements seem to be installing the general ALSA software, as well as letting the Docker container access the /dev/snd of the host OS. I don’t know if the kernel running inside the Docker must have the Pisound kernel module built and installed for it, or if it’s enough to have the host OS have it.

So the first step would be to get the audio flowing, without worrying about the button software for now.

By the way, are you sure that Docker is the right solution?

Are you looking for a way to create an SD card image for use with Raspberry Pi’s?