Setting Up Docker

NER has phased out some direct docker usage. Please see the firmware page for more info.

 

 

Overview

Embedded Software

For embedded firmware, we use a centralized docker container to contain embedded tools that work best on a single, Linux-based platform. This helps ensure we can allow all members to have easy and consistent access to certain tools that may not be available of work as well on different platforms. While in our setup, you may not manually need to interact with the container much, it is encouraged to understand how and why its used, as its a very industry-standard tool

 

TODO Dylan: update the usage section

Installation

  1. Install docker. For Mac and Windows, you must install docker desktop instead.

  2. If using Windows follow two more steps because Docker for Windows runs on WSL (Windows Subsystem for Linux):

    1. Install WSL by running wsl --install

    2. Setup wsl by launching ubuntu from the start menu

Usage

MacOS

  1. Make sure Docker Desktop is started

  2. Clone and open a terminal in a embedded project.

  3. Pull down the Docker container you are using by running docker compose pull.

  4. Start the container by running docker compose run --rm ner-gcc-arm.

    1. Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)

Linux

  1. Clone and open a terminal in a embedded project.

  2. Pull down the Docker container you are using by running docker compose pull.

  3. Start the container by running docker compose run --rm ner-gcc-arm.

    1. Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)

Windows

  1. Make sure Docker Desktop is started and wsl ubuntu is installed (see above setup)

  2. To mount any flashing hardware (this may be condensed into a script in the future):

    1. Open a Windows terminal with admin privileges and run winget install usbipd

    2. Open a WSL terminal (wsl) and run the following commands to enable mounting Windows USB devices in the Docker container

      1. Leave the terminal open

    3. (If interacting with hardware) Mount the Raspberry Pi probe by finding the device in another Windows terminal with usbipd list and mount the device in a Windows terminal window (with admin privileges the first time you do this) with usbipd bind --busid=<BUSID>

      1. You’re looking for the CMSIS-DAP v2 Interface device

    4. Run usbipd attach --wsl=ubuntu --busid <BUSID>.

    5. Clone and open a terminal in a embedded project.

    6. Pull down the Docker container you are using by running docker compose pull.

    7. Start the container by running docker compose run --rm ner-gcc-arm.

      1. Make sure you are running it in the root directory of the project (Ex. Cerberus, Shepherd, Iroh, Proteus, etc.)

All future mounts after the first time on the device should be:

  1. Open docker desktop and plug in debug probe

  2. usbipd list to get the pi debug probe BUS ID

  3. usbipd attach --wsl --busid <BUSID>

  4. docker compose run --rm ner-gcc-arm