|
| 1 | +# A Docker image for Embedded C++17 CI builds |
| 2 | + |
| 3 | +This Docker container extends `13coders/cpp17-base`, [located in |
| 4 | +DockerHub](https://hub.docker.com/r/13coders/cpp17-base/) with tooling |
| 5 | +for ARM Cortex-M development. Please check the base image for more |
| 6 | +detailed documentation. |
| 7 | + |
| 8 | +## Features |
| 9 | + |
| 10 | +The base image contains a complete set of C++ tooling for amd64 |
| 11 | +development, as well as extending from the official Jenkins |
| 12 | +image. Added components in this image are: |
| 13 | + |
| 14 | +| Component | Source | Version | Notes | |
| 15 | +| --- | ---| --- | --- | |
| 16 | +| [usbutils](https://packages.debian.org/stretch/usbutils) | apt-get | | Gives `lsusb` for debugging USB connection issues | |
| 17 | +| [GNU Arm Embedded](https://developer.arm.com/open-source/gnu-toolchain/gnu-rm) | S3/binary | 7-2017-q4-major | Toolchain for Cortex-M/R development | |
| 18 | + |
| 19 | +In addition, this image adds the `jenkins` user to the `plugdev` group |
| 20 | +for connection to USB hardware for deployment/flash of binaries for |
| 21 | +on-device testing or profiling - or just as a reproducible |
| 22 | +version-controlled deployment for other manual test with hardware |
| 23 | +diagnostic tools and debuggers. |
| 24 | + |
| 25 | +It's expected that this image will in turn be extended for specific |
| 26 | +debug toolchains. |
| 27 | + |
| 28 | +## Running the CI server |
| 29 | + |
| 30 | +Please consult the `13coders/cpp17-base` documentation for a fuller |
| 31 | +description of the container launch. |
| 32 | + |
| 33 | +We'll note here that it's also generally necessary to pass USB devices |
| 34 | +into the container launch for any embedded USB hardware that you need |
| 35 | +to interact with. It is strongly preferred to do this rather than run |
| 36 | +the container as `--privileged`. |
| 37 | + |
| 38 | +On the host side, running the `lsusb` command would show the USB |
| 39 | +device we want to access in the container: |
| 40 | + |
| 41 | +``` |
| 42 | +$ lsusb |
| 43 | +... |
| 44 | +Bus 001 Device 009: ID 1366:0101 XYZ PLC JTAG/SWD Debug Probe |
| 45 | +... |
| 46 | +``` |
| 47 | + |
| 48 | +The bus and device are then identified to Docker when we launch the |
| 49 | +container with the `--device` argument shown below (see the base image |
| 50 | +documentation for an explanation of the other command-line arguments): |
| 51 | + |
| 52 | +``` |
| 53 | +$ docker run \ |
| 54 | + -p 8080:8080 \ |
| 55 | + -p 50000:50000 \ |
| 56 | + -v /path/to/local/dir:/var/jenkins_home \ |
| 57 | + --cap-add SYS_PTRACE \ |
| 58 | + --device=/dev/bus/usb/001/009 \ |
| 59 | + 13coders/cpp17-base |
| 60 | +
|
| 61 | +``` |
| 62 | + |
| 63 | +It's worth noting also that Docker containers are immutable after |
| 64 | +launch, and although unplugging and re-inserting USB cables for |
| 65 | +embedded hardware on the host side might result in `udev` picking up |
| 66 | +the reinserted device, the container will not see it. Leave embedded |
| 67 | +test hardware plugged in throughout the container run. |
0 commit comments