Ros2 galactic docker unable to store files

Hi I’m having an issue running the docker image for ROS2 Galactic on my Jetson Nano 4GB, Model B01, running Jetpack-SDK-4.6.3 (after upgrading from 4.6.1)

Here are the steps taken so far:

  1. create directory
  2. copied shell script docker_run.sh from repo (GitHub - dusty-nv/jetson-containers: Machine Learning Containers for NVIDIA Jetson and JetPack-L4T)
  3. modify to use the right tag: CONTAINER_IMAGE=“dustynv/ros:galactic-pytorch-l4t-r32.7.1”
  4. save and make it executable: chmod 755 docker_run.sh
  5. run it ./docker_run.sh

Any changes made within are not retained.
I also get a warning message, but still continues

xhost:  unable to open display ""
xauth:  file /home/administrator/.Xauthority does not exist
xauth: (argv):1:  unable to read any entries from file "(stdin)"

Then I tried to install ros2 galactic, following the steps in the ros documentation. And just to note I have installed ROS (1+2) on about 12 machines so far and never had as many issues. I had to abandon the idea of installing it and reverted back to using Docker.

Please someone, give me a more detailed list of steps, og how I’m supposed to use the ros2-galactic-docker ?

Also pulling images from docker hub and then trying to compile using scripts and commands from the repo mentioned above just plain out fails, as I have updated minor release and am now on R32.7.3 and then it complains it can’t find it. I was able to override the variable in the shell-script, that looks the L4T info up, but it still didn’t proceed.
That was scripts/l4t_version.sh

Please anyone, I’m stuck

Hi @andrew.cra2019, it is normal/expected for changes that you make in a container to be lost after the container is shutdown. There are several ways to make persistent changes:

  • remove the --rm flag from scripts/docker_run.sh#L113
    this will make it so that the container is ‘persistent’ and not removed after you exit it. you can then re-connect a terminal to the container with the docker attach command

  • use the docker commit command to save the updated container image to a new tag. you would then run that new tag when you start the container again, instead of the original tag.

  • create your own Dockerfile which uses the original container as it’s base image, and apply your customizations/changes in the Dockerfile, and then build your new container using docker build

  • mount your external projects/assets into the container from the host device (see the --volume argument to docker_run.sh)

The issue was probably that Galactic expects Ubuntu 20.04 if I recall correctly, and the Nano is on Ubuntu 18.04. In theory you could build Galactic from source following similar steps to what I do in the container, but I find using the containers a cleaner way to keep the build environment self-contained and also distributable to other Jetson devices. I’ve not found an easy way to build the ROS2 debian packages themselves.

Thank you very much @dusty_nv for your reply and all the great work!

Will get to try the suggestions soon

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.