ASL Docker Image

Hi All,

I started migrating my server where I run a ASL Hub and the Analog to Digital bridge to a docker architecture and I’m having issues getting ASL to run inside a container. The ASL installation completes without issues but after setting all the parameters the Asterisk doesn’t start.

I’m wondering if anyone has ASL running in a docker container already.

73’ KP4IP

1 Like

Hello Frank,

How’s the Docker project going? Any progress?

1 Like

Hi Tim,

I stopped the project and move the HUB to a VMware for now until I finish with the docker image.

73’ KP4IP

1 Like

Feel free to send over the dockerfile to me and I’ll try it on my end.

Has anybody been successful in running ASL in docker yet?

Thanks
Shane
M0VUB

Should be doable with docker-compose and a Debian image.

Hi Tim, it’s not that easy to do unfortunately. I’ve tried it and failed to compile. Using the repo is successful but… and this is massive but…systemd is not available in docker, (politics). It probably can be run in docker but it’s beyond my expertise. Not unless I throw some hours at it. Maybe someone will build a Dockerfile and a compose file one day. Who knows :slight_smile: , thanks Tim keep up the good work! It’s amazing stuff! Looking forward to future developments :wink:

Shane
M0VUB

It’s not politics, it’s technical. It’s not a VM it’s a container. But you can run systemd with the privileged setting. Check it out.

Hi,

I work with Docker on a daily basis. Could you please share your Dockerfile?

Thanks and 73 de N8PWM

1 Like

I would also like to fiddle around with it too.

I also would love containerized ASL.

My experience was problems installing ASL-DAHDI. This was about a month ago, so I don’t have logs of the error I was getting, but I’ll try to summarize as best as I recall.

My host is Debian Bullseye. So I start with a base Debian Buster image. From there, I followed the instructions for installing ASL on buster. When it came to installing asl-dahdi, it would not install because the the kernel version being reported was my host’s kernel, not buster’s.

For this particular install, I ended up building ASL from source on the bare metal Bullseye. Aside from gathering a few dependencies, it was more-or-less straight forward.

So, I’m inclined to believe it is possible to run ASL in a container. But I would have LOVED a dockerfile / docker-compose file. This too is a bit out of my expertise level.

Don’t know if this info helped, other than to bump the topic.
73

I decided to take another stab at it.

The Dockerfile is on my github. GitHub - KM6IAU/asl-docker

I’ve got 2 dead-ends.

1st dead-end:

cd /ASL-Asterisk/asterisk
./configure #finishes successfully
make # fatal error

The fatal error is:

../astver.h:55:10: fatal error: zaptel/tonezone.h: No such file or directory
 #include <zaptel/tonezone.h>
          ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[1]: *** [/ASL-Asterisk/asterisk/Makefile.rules:42: chan_voter.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make[1]: Leaving directory '/ASL-Asterisk/asterisk/channels'
make: *** [Makefile:361: channels] Error 2

Some googlefu suggests that dahdi replaced zaptel, so I figured I might try building asl-dahdi first… which leads to dead-end #2:

cd /ASL-DAHDI/
make

result:

make -C linux all
make[1]: Entering directory '/ASL-DAHDI/linux'
make -C drivers/dahdi/firmware firmware-loaders
make[2]: Entering directory '/ASL-DAHDI/linux/drivers/dahdi/firmware'
make[2]: Leaving directory '/ASL-DAHDI/linux/drivers/dahdi/firmware'
You do not appear to have the sources for the 4.15.0-200-generic kernel installed.
make[1]: *** [Makefile:72: modules] Error 1
make[1]: Leaving directory '/ASL-DAHDI/linux'
make: *** [Makefile:9: all] Error 2

(Of course, I did apt-get install linux-headers-amd64 in the Dockerfile.) This was essentially the problem I had a month ago, and mentioned in the previous post. I may have solved the #1 problem a month ago, but I forgot how, if so. :rofl:

1 Like

I’ve just created a multi-stage Dockerfile that builds from the git repo inside a debian:buster-slim image. In the process I discovered some errors in the sounds/Makefile which was pointing to an old URL and README.md which had some missing build dependencies.

I created pull requests for the fixes:

The Dockerfile itself was pretty straightforward, once I finally, after several hours, discovered that the repository authentication was failing due to a permissions error on the key.

I intend to publish the Dockerfile as a pull request as well. Hopefully before the end of today. I just have to figure out how to do that from the command line and not the GitHub GUI :slight_smile:

Here’s the content, note the sed command which fixes the URL in the Makefile, this shouldn’t be part of the final file and note that the dependencies contain the missing ones and are sorted alphabetically so you can see if you missed any or doubled up:

FROM debian:buster-slim AS builder
LABEL maintainer="cq@vk6flab.com"

ARG DEBIAN_FRONTEND=noninteractive

ADD https://apt.allstarlink.org/repos/repo_signing.gpg /usr/share/keyrings/allstarlink-keyring.gpg
RUN chmod +r /usr/share/keyrings/allstarlink-keyring.gpg
RUN echo "deb [signed-by=/usr/share/keyrings/allstarlink-keyring.gpg]  http://apt.allstarlink.org/repos/asl_builds buster main" > /etc/apt/sources.list.d/allstarlink.list

RUN apt-get update
RUN apt-get -y install \
	asl-dahdi-source \
	build-essential \
	cmake \
	devscripts \
	doxygen \
	freetds-dev \
	g++ \
	git \
	graphviz \
	gsfonts \
	libasound2-dev \
	libboost-all-dev \
	libcap-dev \
	libcurl4-openssl-dev \
	libgmp-dev \
	libgsm1-dev \
	libi2c-dev \
	libiksemel-dev \
	libjansson-dev \
	libnewt-dev \
	libpopt-dev \
	libpq-dev \
	libpri-dev \
	libreadline-gplv2-dev \
	libsnmp-dev \
	libspeex-dev \
	libspeexdsp-dev \
	libsqlite-dev \
	libssl-dev \
	libtonezone-dev \
	libusb-dev \
	libvorbis-dev \
	libvpb-dev \
	python3-numpy \
	quilt \
	swig \
	unixodbc-dev

RUN git clone https://github.com/AllStarLink/ASL-Asterisk.git

WORKDIR ASL-Asterisk/asterisk

# The Makefile has the wrong URL - see https://github.com/AllStarLink/ASL-Asterisk/pull/50
RUN sed -i 's|http://downloads.digium.com/pub/telephony/sounds/releases|http://downloads.asterisk.org/pub/telephony/sounds/releases|g' sounds/Makefile

RUN debuild -b -us -uc

FROM debian:buster-slim
LABEL maintainer="cq@vk6flab.com"

ARG DEBIAN_FRONTEND=noninteractive

COPY --from=builder /ASL-Asterisk/*.deb /tmp/

RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get -y install /tmp/*.deb
RUN rm /tmp/*.deb

I’ve just discovered a Dockerfile in the source here:

I’ve not trialled it and it appears to use some non-Debian approach to building from source, nor does it appear to take advantage of multi-stage Docker builds which reduces the size of the container significantly, it also doesn’t follow the instructions in the README.md which is a little surprising.

I’m not sure where, or even if, to contribute my Dockerfile, so for the moment, until others more experienced with this project chime in, I’ll leave well enough alone. I have no desire to step on anyone’s toes.

Anyone have any opinions on the matter?

73 de Onno VK6FLAB

1 Like

Hi Onno thanks for making the Dockerfile… I’m going to try yours out because I’m interested in getting ASL to work in a docker container.

Perhaps… unless others have a better suggestion… I’d suggest maybe for now make your own github repo just for the Dockerfile and maybe a Readme.md, and a docker-compose.yml explaining how to use it. It can always be merged into ASL-Asterisk when it matures enough and contributed back to the project.

I get the impression the Dockerfile you found is for building the deb files only… not run from docker. I like your multi-stage approach.

73 de Dave AC8ZD

Great to hear! Sorry for the delay in responding, didn’t get notified of your reply. I’ll peruse the forum preferences…

Word of caution.

The container my Dockerfile builds does not appear to have any of the post_install scripts. As I see it, this is a bug in the Makefile, since the debuild stage should automatically take care of that. I’m trying to figure out what’s wrong specifically so I can lodge another patch.

I’ll also note that I’ve not yet published this elsewhere, specifically on github yet, since I am not sure how to make the contribution in the most effective way.

I can fork the official repo, delete the content of the current docker directory and submit my effort as a patch, which has the benefit of being linked to the official repo and a pull request is a request to incorporate my suggestion. It has the potential of languishing in neverland, since it might offend the person who wrote the current docker directory.

Alternatively I can create a stand-alone repo with just my Dockerfile, but that will be a completely separate repo and fragments the project, which to be honest, is already pretty fragmented with scripts and repos left right and centre. I don’t want to make it worse.

So, I’m leaning toward option 1.

Thoughts?

Also, I’m attempting to discover the minimum list of required libraries since the list in the documentation does not appear to be correct.

Do you have a git repo for this? Would like to give it a try.

Have fun,
Alan
KM4BA

Was anyone able to get this running in docker?

I think this is going to be a terrifically complicated task.

I have successfully containerized Allmon3

I have a pull request open, not sure if it will be accepted.

I’ve tested it with his most recent version of his deb, and the image builds on x86 and a raspberry pi 4.

I know there’s still A LOT more to do, but… I think i’ll be a fun challenge (i say that now).

Apologies for the rudamentary Dockerfile, I know just enough Dockerfile authoring to be dangerous but not much else.

I appreciate any and all input!

I decided to also follow the VM path. Proxmox been a joy to work with.