Skip to content
Yoshua Nava edited this page Feb 22, 2018 · 5 revisions

We provide a Dockerfile that allows you to install and run all the dreambed dependencies inside a Docker container. This may be useful if you don't have the recommended system setup (Ubuntu 14.04 with ROS Indigo), or you prefer not to install the manipulation dreambed dependencies locally.

Instructions

To facilitate running the dreambed container(s), we have prepared a set of helper scripts (under the folder Bash), that allow you to:

  • Build a Docker image from the Dockerfile.
  • Create a container from the built image.
  • Start the container.
  • Execute a container as a regular user or as root.
  • Delete the container.
  • Delete the built image
  • Pre-specify parameters such as image name, container name, location of shared folders (mounted as Volumes), and choose if you want to use the nvidia-optimized or the regular docker app.

Preliminaries

Before you start using the scripts, run the file set_docker_aliases.sh located in this repository root. It will echo a set of shortcuts for our helper scripts into your .bashrc file.

./set_docker_aliases.sh

Docker image & container creation

Once that's set, you'll need to build a Docker image from the provided Dockerfile, a process that will take around 20 minutes. In order to do so, run:

build_dreambed_image  (this one will take around 20mins, as we need to build everything)

Then, create a Docker container by executing:

create_dreambed_container

If everything went well, the container will be started and you'll be automatically logged-in. If you want to close the current session, type exit

How to start, run and stop the container

Docker containers need to be started everytime you're going to use them. Run the following command to start the dreambed container:

start_dreambed_container 

Next, execute (i.e. log into) the started container:

exec_dreambed_container

Note: you can run exec_dreambed_container from multiple terminals. This may prove useful if, for example, you want to run roscore in one terminal, the dreambed packages in another, and system-performance tools like htop or ps.

You can also log into the container as root:

rootexec_dreambed_container

Whenever you want to stop the running containers, just type:

stop_dreambed_container

How to delete existing containers or imagers

If you want to delete the existing container, type:

delete_dreambed_container

Finally, in case you want to delete the current build of the manipulation dreambed Dockerfile, run:

delete_dreambed_image

Parameters

The parameters used for the creation of the dreambed Docker image when using the helper scripts are declared in the file Bash/common_vars.sh.

For best performance, we recommend that you only edit the parameters that appear in the following list:

  • IMAGE_NAME: this is the name of the docker image that will be built. Default: 'dreambed_img'.
  • CONTAINER_NAME: name of the container to be created. Default: 'robdream_container'
  • USE_NVIDIA_DOCKER: enable use of nvidia-docker. Default: 'false'
  • CONTAINER_USER: the username that you'll when running the containers. Default: 'robdream'
  • CONTAINER_FOLDER: a shared folder inside the container. Default: '/home/$CONTAINER_USER/shared_folder'
  • LOCAL_FOLDER: a directory in which the container shared folder will be mirrored. Default: '/home/$USER/robdream_docker/'