Skip to content

Add devcontainer support for easier development environment

Before raising this MR, consider whether the following are required, and complete if so:

  • Unit tests
  • Metrics
  • Documentation update(s) - Pending, will update README.rst

If not required, please explain in brief why not.

Description

This PR adds support for VSCode devcontainers to make spinning up a development environment with all the necessary tools needed to develop buildbox-common. It leverages the existing Dockerfile and installs useful extensions for building C++ code and running tests.

The only changes to anything existing are:

  1. Adding clang-format to the Dockerfile, to allow running clang-format easier.
  2. Adding a non-root user builder in the Dockerfile, which makes the bind-mount of the workspace not write files as root which causes issues.

Changes proposed in this merge request:

  • Add .devcontainer/devcontainer.json which spins up a development container based on the existing Dockerfile
  • Add clang-format to the apt-get install list in Dockerfile
  • Add 'builder' non-root user in Dockerfile and run devcontainer processes by that user.

Validation

Open up this repository in VSCode and click "Reopen in container" when prompted, which will start building development container. It takes a couple of minutes to fully install/active all the extensions, but once active you should see buttons for configuring CMake, running the build, running tests, etc.

Issues addressed

My sanity when developing this project.

Edited by Jeremiah Bonney

Merge request reports

Loading