../_images/tiago-icon.png ../_images/tiagopro-icon.png ../_images/ari-icon.png

Deploying a Docker image on the robot#

This page describes how to install docker images inside the robot computer and run docker containers from the startup system.

Introduction#

If you need to run software that cannot be installed in the same machine as the provided versions of OS or ROS, you can prepare a Docker image and start a container inside the robot with a controlled environment.

This section assumes that you know how docker works, you have prepared your docker image and you are ready to run it inside the robot.

The ros_docker_wrapper package#

Make sure the ros_docker_wrapper package is installed in the robot, if not you may need to ask for a software upgrade.

If this package is installed, the docker packages should be installed and you should be able to run the command docker list to list the installed images, which is empty by default.

The docker images are stored in /home/pal/docker_dir so they are persistent between reboots. You should not need to modify this directory.

Installing new docker images#

If the robot is connected to the internet, simply docker pull the image you need and it will be stored in the robot hard drive.

If the robot is not connected to the internet, or is unable to access your image for any other reason, you can download the image on a separate machine and copy it to the robot:

# From outside the robot
docker pull YOUR_IMAGE_NAME
# Save this image to a file
docker save -o YOUR_IMAGE_NAME.docker YOUR_IMAGE_NAME
# Transfer the file to the robot
scp YOUR_IMAGE_NAME.docker pal@tiago-0c:/tmp/
# Load the image in the docker daemon of the robot
docker load -i /tmp/YOUR_IMAGE_NAME.docker

Running containers#

Standard docker commands can be used to run docker containers.

Additionally, ros_docker_wrapper has an executable script that executes docker run, this simplifies integration with other ROS tools.

For example: rosrun ros_docker_wrapper run_docker.sh --rm -it ros:noetic-robot bash

This script can be integrated in a startup for automatic running of docker containers.

See also#