Skip to content
Snippets Groups Projects
Commit 3cccf789 authored by Tim Kluge's avatar Tim Kluge
Browse files

ref #1: Experimental vnc docker setup

parent 5ab79155
No related branches found
No related tags found
No related merge requests found
FROM osrf/ros:melodic-desktop-full-bionic
FROM henry2423/ros-vnc-ubuntu:melodic
ARG uid=1000
ARG gid=1000
USER root
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
# Updated ros gpg key: https://github.com/henry2423/docker-ros-vnc/issues/1
RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN apt-key del 421C365BD9FF1F717815A3895523BAEEB01FA116
ENV USERNAME ros
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \
usermod --shell /bin/bash $USERNAME && \
usermod -aG sudo $USERNAME && \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \
chmod 0440 /etc/sudoers.d/$USERNAME && \
# Replace 1000 with your user/group id
usermod --uid $uid $USERNAME && \
groupmod --gid $gid $USERNAME
COPY ./vnc-entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
RUN apt-get update && apt-get install -y \
python-catkin-tools bash \
mesa-utils libgl1-mesa-glx
WORKDIR /home/$USERNAME
COPY src /home/$USERNAME/src
RUN rosdep install --from-paths . -r -y
COPY ./src /src/src
WORKDIR /src/
ENV ROS_DISTRO=melodic
RUN apt-get update && rosdep install --from-paths . -r -y
RUN catkin config \
--extend /opt/ros/melodic && \
catkin build
......
<?xml version="1.0"?>
<XLaunch xmlns="http://www.straightrunning.com/XmingNotes" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.straightrunning.com/XmingNotes XLaunch.xsd" WindowMode="MultiWindow" ClientMode="NoClient" Display="0" Clipboard="true" NoAccessControl="true"/>
start config.xlaunch
docker build . -t ceti-panda-gazebo-workspace
docker run -it^
--env="DISPLAY=host.docker.internal:0"^
--user="ros"^
-p 5901:5901 -p 6901:6901^
ceti-panda-gazebo-workspace^
%*
......
......@@ -2,15 +2,7 @@
docker build . -t ceti-panda-gazebo-workspace
XSOCK=/tmp/.X11-unix
/usr/X11/bin/xhost + 127.0.0.1
defaults write org.macosforge.xquartz.X11 enable_iglx -bool true
docker run -it \
--volume=$XSOCK:$XSOCK:rw \
--env="LIBGL_ALWAYS_INDIRECT=1" \
--env="DISPLAY=host.docker.internal:0" \
--user="ros" \
-p 5901:5901 -p 6901:6901 \
ceti-panda-gazebo-workspace \
"$@"
\ No newline at end of file
#!/bin/bash
# http://wiki.ros.org/docker/Tutorials/GUI
docker build . -t ceti-panda-gazebo-workspace \
--build-arg UID=$UID \
--build-arg GID=$GID
XSOCK=/tmp/.X11-unix
XAUTH=/tmp/.docker.xauth
touch $XAUTH
xauth nlist $DISPLAY | sed -e 's/^..../ffff/' | xauth -f $XAUTH nmerge -
docker run -it \
--volume=$XSOCK:$XSOCK:rw \
--volume=$XAUTH:$XAUTH:rw \
--env="XAUTHORITY=${XAUTH}" \
--env="DISPLAY" \
--device=/dev/dri \
--group-add video \
--user="ros" \
ceti-panda-gazebo-workspace \
"$@"
\ No newline at end of file
#!/bin/bash
source /opt/ros/melodic/setup.bash
source /src/devel/setup.bash
exec /dockerstartup/vnc_startup.sh $@
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment