/ros-kinetic-nvidia-docker

ROS Kinetic desktop-full Docker image that works with nvidia-docker2 (and CUDA)

Primary LanguageDockerfileMIT LicenseMIT

ros-kinetic-nvidia-docker

Extends the osrf/ros:kinetic-desktop-full image by adding opengl, glvnd and cuda 8.0. This makes opengl work from any docker environment when used with nvidia-docker2. Thanks to phromo for the baseline. Note that this is currently supported for Linux systems only.

To extend the Dockerfile (e.g. to add more ROS packages or users), take a look at the commented out lines at the end of file.

Installation

  1. Install docker
  2. Install nvidia-docker using instructions here.
  3. After cloning this repo, run sudo docker build -t <image_name> ros-kinetic-nvidia-docker/
  4. Run the following commands to give docker permission to run on X:
xhost +local:docker
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
sudo touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | sudo xauth -f $XAUTH nmerge -
  1. Start the container:
sudo nvidia-docker run -it --volume=$XSOCK:$XSOCK:rw
--volume=$XAUTH:$XAUTH:rw --env="XAUTHORITY=${XAUTH}"
--env="DISPLAY" <image_name>