Skip to content

Example workspaces

Here are some example workspace setups

Multi stage docker build (multistage)

This will build and compile your code into a small output image by building your code during dockerfile creation.

Pros:

  • One file defines everything you need to create the image
  • Repeatability built in

Cons:

  • Takes longer to compile when a file changes (about the same as building from scratch)

Docker development environment copied into final image (dev_release)

This will build the workspace on your host machine using a docker image as the development environment.

Pros:

  • Fastest re-build time because you can use cmake cache
  • Small output image possible by passing targets into final image

Cons:

  • Requires multiple dockerfiles to set up
  • Not as repeatable (your local cache may affect build)

Docker development through VS Code (dev_release_vscode)

This will use the VS Code Dev Containers extension as the basis of development.

Under the hood, VS Code runs a Docker container and mounts your source code into it. This gives you the tooling you need to build your code and can standardize tools including linters. It also integrates with IntelliSense and enables debugging through traditional debuggers such as GDB.

It seems to follow the develop-release pattern with docker, where a develop container is created for compiling and a then the built assets can be copied into a deployment container. It is also possible to support multi-stage, but development would be in a docker-in-docker configuration.

Pros:

  • All developers using the same tools (including linters, etc) in an easy to share setup
  • Supported IDE functionalities such as intellisense, code following, debugging, etc.

Cons:

  • Built targets have "root" permissions unless you've updated your base docker image to have your user name/group.

Bazel workspace with VS Code (bazel)

This will use the VS Code Dev Containers extension as the basis of development for a Bazel environment.

ROS melodic workspace (ros_melodic_vscode)

This is similar to the vscode_ros2_workspace but for ROS1.

  • TODO: Make this its own template.