Skip to content


This is an example of how to create a docker development workflow

Quick start

Run all the steps to get the code, build the development docker and build your code.


Set up

Set up your workspace

make setup


Make the development environment docker

make docker


Make the workspace using the development docker

make example


Set up your workspace

Create a directory to put your source code.


mkdir -p src

Clone the repositories you would like to build from source


cd src
git clone

Build the dockerfile

Edit the docker file to include all additional resources and build the development dockerfile. This file is special because it is built with your user id/group/name. This allows you to build within the docker workspace as yourself.

cd ~/workstation_setup/examples/ros2_crystal_example_dev
docker build -f develop.dockerfile -t althack/ros2:crystal-example-dev  --build-arg UID=$(id -u) --build-arg GID=$(id -g) --build-arg UNAME=$(whoami) .

Build inside the docker image

Run the docker image with the build function

cd ~/ros2_ws
docker run -v $HOME:$HOME althack/ros2:crystal-example-dev / `pwd`

Copy install targets into release docker image

Build the release docker image that will copy the install targets into the image

docker build -f release.dockerfile -t ros2:crystal-example-release .