Sign inSign up

uavcan/c_cpp

By uavcan

•Updated over 5 years ago

Container-as-toolchain for UAVCAN C and C++ projects

Image
1

10K+

uavcan/c_cpp repository overview

⁠C/C++ Toolchain Docker

The uavcan/c_cpp docker image provides a consistent build and test environment for development, continuous-integration, and test automation of C and C++ based projects.

⁠Manual Build and Push

These instructions are for maintainers with permissions to push to the uavcan organization on Docker Hub⁠.

docker build .
docker images

REPOSITORY   TAG      IMAGE ID       CREATED              SIZE
<none>       <none>   736647481ad3   About a minute ago   1GB
docker tag 736647481ad3 uavcan/c_cpp:ubuntu-20.04
docker login --username=yourhubusername
docker push uavcan/c_cpp:ubuntu-20.04

Use this pattern for tags:

uavcan/[toolchain]:[build environment]

⁠Testing out the container

To login to an interactive session do:

docker run --rm -it -v ${PWD}:/repo uavcan/c_cpp:ubuntu-20.04

⁠Toolchain Documentation

⁠Sonarqube

Wrap yer build:

build-wrapper-linux-x86-64 --out-dir build_wrapper_output_directory cmake --build build/

Upload the results:

sonar-scanner \
  -Dsonar.organization=uavcan \
  -Dsonar.projectKey=UAVCAN_myproject \
  -Dsonar.sources=. \
  -Dsonar.host.url=https://sonarcloud.io \
  -Dsonar.cfamily.build-wrapper-output=bw-output \
  -Dsonar.login=TOKEN

A CMake example on github⁠

⁠Travis CI

You can use this in your .travis.yml like this:

services:
  - docker

before_install:
- docker pull uavcan/c_cpp:ubuntu-20.04

script:
- docker run --rm -v $TRAVIS_BUILD_DIR:/repo uavcan/c_cpp:ubuntu-20.04 /bin/sh -c mybuild_command

⁠BuildKite

Example pipeline.yml:

- label: ":github: my containerized build"
    command: "my_build_command"
    plugins:
      - docker#v3.5.0:
          workdir: /repo
          image: "uavcan/c_cpp:ubuntu-20.04"
          propagate-environment: true
          mount-ssh-agent: true

Tag summary

Content type

Image

Digest

Size

914.9 MB

Last updated

over 5 years ago

docker pull uavcan/c_cpp:ubuntu-20.04