User Tools

Site Tools


using_docker_containers

Using docker containers

Current conventions for the GNURadio images provided by CorteXlab

Use prebuilt images

Prebuilt images are listed here. These can be used either directly, if one wants to run a very simple GNU Radio flowgraph, or as the basis for a custom image.

Lib install location

In prebuilt images, the “CorteXlab toolchain” is installed in /cortexlab/toolchain/current. That includes all radio related software, such as GNURadio, drivers, plugins, custom libraries. There is a clean and clear separation between linux-distribution provided software, and software explicitely built by our Dockerfiles. But the environment needs to be correctly set for the toolchain to work. When adding custom libraries or GNURadio out of tree modules, it's better to install them in /cortexlab/toolchain/current along the rest of the toolchain. For instance, when building a GNU Radio OOT module, use the Install prefix option in cmake:
cmake -DCMAKE_INSTALL_PREFIX=/cortexlab/toolchain/current <OTHER OPTIONS> ..

Correct environment setup

To set the environment correctly for the CorteXlab toolchain to be seen, the script /cortexlab/toolchains/current/bin/cxlb-toolchain-user-conf needs to be sourced. For an interactive bash session such as when connecting via ssh as shown in tutorial 1, this is done automatically because a link to this script is added in /etc/profile.d/. But for raw commands in minus scenarios, it doesn't: when docker executes a command in a container, it does not automatically runs the command inside a shell, thus the environment is not automatically setup.

The workaround is to include the following in the minus scenario:
command: bash -lc "<actual command to run>"

When building a docker image, however, the trick is to add this line at the beginning of the dockerfile:
SHELL [ “/bin/bash”, “-lc” ]

using_docker_containers.txt · Last modified: 2023/09/04 11:13 by cmorin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki