IRNAS / irnas-docker-software

Docker images for building the various Zephyr projects
MIT License
2 stars 1 forks source link

Irnas's repository for Zephyr Docker images

This repository contains images that are used for building the various Zephyr projects.

Available images

vanilla-zephyr

This image is based on the official Zephyr image and contains the Zephyr SDK and Python dependencies to build Zephyr applications.

The vanilla-zepyhr folder contains two Dockerfiles:

Naming scheme

This images adhere to the following naming scheme:

ghcr.io/irnas/vanilla-zephyr-<zephyr-version>-<image-type>:<tag>

Where:

ncs-zephyr

This image is based on the Nordic's nRFUtil toolchain-manager binary that provides the environment for build NCS applications. to build Zephyr applications.

The ncs-zepyhr folder contains only a single Dockerfile with two multi-stage builds:

[!WARNING] Using the CI image to create a container in the GitHub Actions workflow it is mandatory to change the default shell to bash -l {0} by modifying the default.run.shell field. The shell must be login shell to source the environment variables correctly, otherwise the installed tools inside the image won't be available.

Naming scheme

This images adhere to the following naming scheme:

ghcr.io/irnas/ncs-zephyr-<ncs-version>-<image-type>:<tag>

Where:

Using pre-built images

To run pre-built images, you need to have Docker Engine installed on your machine. If you don't mind additional Docker programs you can instead install Docker Desktop application which includes Docker Engine.

[!NOTE] Docker should be configured to run without sudo. Follow the [official docs] on how to setup that.

[official docs]: https://docs.docker.com/engine/install/linux-postinstall/#manage-docker-as-a-non-root-user

Once Docker engine is installed, you can pull the image with the docker pull command. Docker images are available on the GitHub Container registry. Click on one of the images to see the exact pull command, for example:

docker pull ghcr.io/irnas/vanilla-zephyr-v3.6.0-dev:latest

Once the image is pulled, you can run it as a container with the following command:

docker run -it --rm \
    --privileged \
    --volume <path_to_projects_top_westdir>:/home/user/workdir \
    --volume /dev:/dev \
    --workdir /home/user/workdir \
    --device-cgroup-rule='c 166:* rmw' \
    <full image name>

Do not forget to replace <path_to_projects_top_westdir> with the path to the top directory of your Zephyr project and <full image name> with the full image name you pulled.

Development

Images can be built with the help of the build scripts located in individual image folders:

./build_ci.sh
./build_dev.sh

There is a accompanying run.sh script that can be used to run the image.

MacOS support

Images currently do not support MacOS, users are required to build them locally. Workarounds is described in the issue.

Making a new release

Take the following steps to make a new release:

  1. Make sure that Unreleased section in the CHANGELOG.md is populated with relevant new additions.
  2. Go under Actions tab and select Create a new release section in the left sidebar.
  3. Click Run workflow button on the right and write in the version tag that you want to make a release for.

After that: