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:
- Adding
clang-format
to the Dockerfile, to allow runningclang-format
easier. - Adding a non-root user
builder
in theDockerfile
, which makes the bind-mount of the workspace not write files asroot
which causes issues.
Changes proposed in this merge request:
- Add
.devcontainer/devcontainer.json
which spins up a development container based on the existingDockerfile
- Add
clang-format
to theapt-get install
list inDockerfile
- Add 'builder' non-root user in
Dockerfile
and rundevcontainer
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.