.. _brash_docker_spaceros:

Building BRASH Docker images with SpaceROS
#################################################

The tutorials up till now have used as base standard ROS2 distributions (Humble). 
BRASH can also be built on top of SpaceROS. These instructions show how to build
brash docker images with spaceROS so we can use robots such as the Mars rover
and the Canadarm with BRASH.


Checkout brash_demonstrations 
==============================

1. Clone this repository:

   .. code-block:: bash
     
      $ cd ${HOME}
      $ git clone git@github.com:traclabs/brash_demonstrations

2. Clone the repos for cFS, brash and juicer.

   .. code-block:: bash
   
      $ cd ${HOME}/brash_demonstrations
      $ ./scripts/clone_repos.sh

Build images (dev mode)
=======================


1. Go to your top folder and build the images:

   .. code-block:: bash

      $ cd ${HOME}/brash_demonstrations
      $ ./scripts/build_images.sh

2. Build the workspace for :code:`fsw`:

   .. code-block:: bash
      
      $ cd ${HOME}/brash_demonstrations 
      $ ./scripts/build_cfe.sh

3. Build the workspace for :code:`rosgsw` :

   .. code-block:: bash

      $ cd ${HOME}/brash_demonstrations  
      $ ./scripts/build_brash.sh
     

Check images
=============

To check your images, you can type in your terminal

.. code-block:: bash

   $ docker image ls

You should see something like:

.. code-block:: bash

   REPOSITORY   TAG       IMAGE ID       CREATED              SIZE
   cfs-dev              latest    02bf072a052f   14 minutes ago   507MB
   spaceros-brash-dev   latest    a0ad2564aca0   14 minutes ago   12.6GB
   <none>               <none>    ccc698db6005   14 minutes ago   12.6GB