ROS lunar-desktop-full image with runtime user creation and X11 forwarding support
3.3K
Dockerfile for ROS melodic desktop-full.
Features:
docker build --rm --pull -t diegoferigo/ros .
docker build --rm --pull --build-arg from=nvidia/opengl:1.0-glvnd-runtime-ubuntu18.04 -t diegoferigo/ros:nvidia .
Several reasons could be found for having a non-root user within the container that matches the GID and UID of your host user.
This docker image allows the creation of a runtime user, whose default UID and GID is 1000. To override these values and to start the container, execute:
docker run -i -t --rm \
-e USER_UID=$(id -u) \
-e USER_GID=$(id -g) \
-e USERNAME=$(whoami) \
--name ros \
diegoferigo/ros \
bash
Then, create as many ttys as needed with
docker exec -it ros bash
The image does not contain sudo and the root password is not set. When the active
user is not root, to execute commands that require admin privileges you should
open a new tty or use exit on the current shell getting back to the root user.
As an example, rqt is forwarded from within the container to the host's Xserver:
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -i -t --rm \
-v $XSOCK:$XSOCK:rw \
-v $XAUTH:$XAUTH:rw \
-e XAUTHORITY=${XAUTH} \
-e DISPLAY \
-e USER_UID=$(id -u) \
-e USER_GID=$(id -g) \
-e USERNAME=$(whoami) \
--name ros \
diegoferigo/ros \
rqt
If you need HW acceleration (only for Intel graphic cards), add also this device
flag --device=/dev/dri.
For what concerns Nvidia GPUs, you need to configure and install nvidia-docker. With such setup, you only have to:
--runtime nvidiadiegoferigo/ros:nvidia imageContent type
Image
Digest
Size
913.1 MB
Last updated
over 7 years ago
docker pull diegoferigo/ros