Using Docker

The Docker image can be used to ease building new apps using a pre-configured environment.

It supports Docker for Mac, Linux and Windows.

To build or run the image, you have to install Docker.


Building image

Build it by the tag knot-zephyr-sdk.

$ docker build --tag=knot-zephyr-sdk .

Running the container

Run the latest image version at CESAR’s Docker Hub and pass the current working directory as the project folder. This folder shall contain all your project files.

At your project folder, run:

$ docker run -ti -v $(pwd)/:/workdir cesarbr/knot-zephyr-sdk:latest

If you want to run it from an image you built, replace cesarbr/knot-zephyr-sdk:latest by the tag you used.

Compile for your target board

container> $ knot make -b {BOARD}

Exporting generated files

Export the generated files to your project’s directory

container> $ knot export /workdir/output

The generated files can now be flashed to your device by using the nRF Connect for Desktop and its Programmer app.


Flashing on Linux

If using a Linux device with the necessary drivers for flashing the boards, you may give USB access to the container.

Before proceeding, make sure that you added your user to the dialout group.

$ sudo usermod -a -G dialout `whoami`

You can now access the container using the host /dev directory.

$ docker run -ti --privileged -v /dev:/dev -v $(pwd)/:/workdir cesarbr/knot-zephyr-sdk:latest

This will allow you to use the –flash flag to flash after building the project.

container> $ knot make -b {BOARD} --flash

Using other knot commands

When inside the Docker container, you may use any KNoT command from the command line interface.

To get a list of all available commands, run:

container> $ knot --help

More info is available at the Thing CLI doc section.