Skip to content

using docker to emulate build farm builds

Marc Hanheide edited this page Nov 12, 2019 · 4 revisions

This page describes the few steps to compile some software in a clean environment, allowing to check if all dependencies etc are correct, in order to avoid the L-CAS build farm complaining about failed builds. It is good practice to do this locally in order to make sure code compiles fine:

  1. Install Docker-CE. (Docker provides a way to run applications securely isolated in a container. Effectively a very efficient virtualisation)
    • add your local user to the docker group so you have access
  2. After docker is installed, you can simply run docker run --rm -it lcasuol/lcas-docker:xenial-base /bin/bash or docker run --rm -it lcasuol/lcas-docker:bionic-base /bin/bash (if you want ROS melodic). This gives you a basic virtual container with ROS and L-CAS repositories enabled (effectively with all installation steps described in "Using L-CAS repository" carried out. This command will download the image and then start a container. (Note: if you leave this container, it will be removed and all resources are purged, that's what --rm does for you)
  3. In the docker container do the following steps:
    1. apt update && apt upgrade (just making sure we have the latest version of everything)
    2. rosdep update (making sure you have the latest rosdep)
    3. mkdir -p workspace/src
    4. cd workspace/src
    5. catkin_init_workspace (init workspace)
    6. git clone YOUR_REPO_URL_HERE (checkout your source)
    7. rosdep install -y -i --from-paths . (install all the dependencies defined in your package.xml, this should install all packages your repository needs, and hence will tell you if you need to declare more if your build later fails)
    8. catkin_make_isolated -C .. --install (this is doing catkin in each found package individually, getting as close to an actual release situation as possible
    9. If things don't work, fix them, and run them again

Make sure you don't leave the container without storing your changes (should you have made any). They will be lost if you leave the container.