8. Using the BRASH Production Docker images

To use the production images to follow the documentation (instead of development), you’ll need to:

  1. Pull the production images from ghcr.io to your machine (we host the images here )

  2. Re-tag them (e.g. from brash_docker/cfs to cfs).

  3. Use the tutorials’ instructions as usual, but referencing docker-compose-prod.yml instead of docker-compose-dev.yml .

8.1. Steps

  1. Checkout the brash_docker repo:

    $ git clone git@github.com:traclabs/brash_docker
    

    Note that we don’t need to clone recursively here, as all the code is compiled in the production images already.

  2. Pull the images:

    $ docker pull ghcr.io/traclabs/brash_docker:cfs
    $ docker pull ghcr.io/traclabs/brash_docker:rosgsw
    $ docker pull ghcr.io/traclabs/brash_docker:rosfsw
    

    The images are public, so anybody can access them. However, you need to be logged in the Github’s container registry. If you cannot pull them (e.g. you get an error saying something about manifest missing) then chances are you are not logged in. See the Note at the bottom of this page for some help.

  3. If everything went well, the prod images should have been downloaded to your machine:

    ana@strelka:~/ros2/brash_docker$ docker image ls
    
    REPOSITORY                      TAG       IMAGE ID       CREATED             SIZE
    ghcr.io/traclabs/brash_docker   rosfsw    5274b9ac2413   58 minutes ago      4.64GB
    ghcr.io/traclabs/brash_docker   rosgsw    2fb6ef416816   About an hour ago   3.93GB
    ghcr.io/traclabs/brash_docker   cfs       c30782762138   About an hour ago   559MB
    
  4. Finally, re-tag the images so they can be used with the production compose file:

    $ docker image tag ghcr.io/traclabs/brash_docker:cfs cfs:latest
    $ docker image tag ghcr.io/traclabs/brash_docker:rosgsw rosgsw:latest
    $ docker image tag ghcr.io/traclabs/brash_docker:rosfsw rosfsw:latest
    
  5. You are done! If you want to use any of the docker-related tutorials, you are all set. Only remember that you have to use the -prod compose file instead of the -dev one. For instance, if an instruction in the tutorials say something like:

    $ docker compose -f docker-compose-dev.yml up fsw
    

    You’ll type instead:

    $ docker compose -f docker-compose-prod.yml up fsw
    

Good luck!

8.2. Additional notes

If you have trouble pulling images from ghcr.io, a likely reason is that you are not logged in to the github’s container registry. If so, the next steps might be helpful:

Note

Accessing images:

To pull the docker images hosted in ghcr.io, you’ll need to do 2 things:

  1. Create a personal access token (classic)

    • Open New personal access token (classic)

    • Give your token a name (eg. “Read package token”)

    • Select the “read:packages” scope.

      Create token 1
    • Click on “Generate Token”.

      Create token 2
    • Copy the token (ie. ghp_...) and store it in a text file.

  2. Login to Github’s container registry

    • Open a new terminal

    • Run “docker login ghcr.io -u my_github_username”, replace my_github_username with your Github username.

    • When prompted for a password, enter the token you generated. (Don’t enter your github password, it won’t work.)

  3. You should be able to pull the docker images now, e.g.:

    $ docker pull ghcr.io/traclabs/brash_docker:cfs