Having had some compatibility problems with the pre-built binaries of the weak signal communications software WSJT-X I wanted to build it from source. But since it has a lot of exotic dependencies and also needs a Fortran compiler, I didn’t want to clutter my (linux) system with these. The solution was to build and run WSJT-X in a Docker container.
I found “Running WSJTX in a docker container” by Aaron Brown but the Dockerfile is a bit outdated and so I had to update it to reflect the current state of the WSJT-X development, as of version 2.7.0. The new one can now be found here. (Or here running as root user – not recommended.)
Having this Dockerfile in the working directory and assuming Docker is already installed on the system (typically by sudo apt install docker.io ) and the normal user is in the Docker group ( sudo usermod -aG docker $USER ), the container image can now be built with:
docker build --pull -t wsjtx .
This will download everything necessary and build WSJT-X in a stripped down Ubuntu system.
In order to enable use of X11 for the container I had to first run:
xhost +
Now, running WSJT-X is done by:
docker run --privileged -v ~/.local/share:/home/user/.local/share -v ~/.config:/home/user/.config -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=unix$DISPLAY wsjtx /wsjtx/output/bin/wsjtx
This runs WSJT-X in Docker as uid=1000 which is the first non-root user. It gives the container access to the locations where WSJT-X stores configuration and saved data. It also runs the container in privileged mode meaning that it has access to all the devices, like sound and comm-ports. This is often not recommended but should be ok if the docker command is not ran as root/sudo. The proper way to do it would otherwise be to forward only the necessary devices by –device /dev/snd etc.
Placing the xhost and docker run commands in a shell script file is perhaps the easiest way to run the program many times.
I must try this ! How is sound from radio routed to container?
LikeLike
Please do! When the container is running with the –privileged option it has access to all devices of the host system. So for me, in linux, it finds /dev/snd and pulseaudio as usual. But since the Docker daemon runs as root this is a bit dangerous.
When the host system is Windows etc, I am not sure if it gets the audio devices correctly but I will try this as well.
LikeLike