Skip to content
Snippets Groups Projects
Commit 7a4f2597 authored by Johannes Mey's avatar Johannes Mey
Browse files

Merge remote-tracking branch 'private/feature/docker-vnc'

parents 253ea1da aae48d4e
Branches
No related tags found
No related merge requests found
FROM osrf/ros:melodic-desktop-full-bionic FROM dorowu/ubuntu-desktop-lxde-vnc:bionic
ARG uid=1000 # Fix dirmngr
ARG gid=1000 RUN apt-get purge dirmngr -y && apt-get update && apt-get install dirmngr -y
RUN apt-get dist-upgrade -y
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh # Adding keys for ROS
RUN sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
ENV USERNAME ros RUN apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
RUN useradd -m $USERNAME && \
echo "$USERNAME:$USERNAME" | chpasswd && \ # Installing ROS
usermod --shell /bin/bash $USERNAME && \ RUN apt-get update && apt-get install -y ros-melodic-desktop-full wget nano python-rosdep
usermod -aG sudo $USERNAME && \ RUN apt-get install -y \
echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers.d/$USERNAME && \ ros-melodic-libfranka python-catkin-tools libeigen3-dev
chmod 0440 /etc/sudoers.d/$USERNAME && \ RUN apt-get install -y python-rosinstall python-rosinstall-generator python-wstool build-essential
# Replace 1000 with your user/group id RUN rosdep init && rosdep update
usermod --uid $uid $USERNAME && \
groupmod --gid $gid $USERNAME RUN mkdir -p /root/ws_tmp /root/Desktop && ln -s /usr/share/applications/lxterminal.desktop /root/Desktop/lxterminal.desktop
ENV ROS_DISTRO=melodic
RUN apt-get update && apt-get install -y \
python-catkin-tools bash \ RUN /bin/bash -c "echo -e 'source /root/Desktop/ros_ws/devel/setup.bash\n \
mesa-utils libgl1-mesa-glx umask 000\n \
WORKDIR /home/$USERNAME cd /root/Desktop/ros_ws/\n' >> /root/.bashrc "
COPY src /home/$USERNAME/src
RUN rosdep install --from-paths . -r -y WORKDIR /root/ws_tmp
COPY vnc/copyws.sh /root/copyws.sh
RUN chmod a+x /root/copyws.sh
COPY ./src /root/ws_tmp/src
RUN apt-get update && rosdep install --from-paths . -r -y
RUN catkin config \ RUN catkin config \
--extend /opt/ros/melodic && \ --extend /opt/ros/melodic && \
catkin build catkin build
ENV OPENBOX_ARGS --startup "/root/copyws.sh"
ENTRYPOINT ["/entrypoint.sh"] VOLUME /root/Desktop/ros_ws
...@@ -10,30 +10,11 @@ ...@@ -10,30 +10,11 @@
## Docker ## Docker
To quickly run the graphical example applications, you can use Docker. For development purposes, please use the regular installation To quickly run the graphical example applications, you can use Docker. For development purposes, please use the regular installation
instructions further below in this document. Please note that the setup for Windows and Mac OS systems uses X11 forwarding and thus instructions further below in this document. Please note that the setup uses vnc and thus offers limited graphics performance.
offers limited graphics performance.
- Clone this repo and its submodules: - Install Docker for your system (for Windows and Mac OS, install Docker Desktop)
- as a guest: `git clone --recurse-submodules https://git-st.inf.tu-dresden.de/ceti/ros/panda_gazebo_workspace.git panda_gazebo_workspace` - Run the container: `docker run -it -p 6080:80 --rm git-st.inf.tu-dresden.de:4567/ceti/ros-internal/panda_gazebo_workspace`. A webserver is run inside the container that is exposed to port `6080` on your system.
- as a project member with a registered ssh key: `git clone --recurse-submodules git@git-st.inf.tu-dresden.de:ceti/ros/panda_gazebo_workspace.git panda_gazebo_workspace` - Open `http://localhost:6080` in a web browser
- Follow the steps for your operating system.
### Linux
- Install Docker for your linux distribution
- Run `./docker-run.sh roslaunch sample_applications sample_simple_simulation.launch` to build and run a docker image tagged with `ceti-panda-gazebo-workspace`
### Windows 10
- Install [Docker Desktop for Windows](https://hub.docker.com/editions/community/docker-ce-desktop-windows)
- Install [Xming](https://sourceforge.net/projects/xming/)
- Run `docker-run.bat roslaunch sample_applications sample_simple_simulation.launch`
### Mac OS
- Install [Docker Destop for Mac OS](https://hub.docker.com/editions/community/docker-ce-desktop-mac)
- Install [XQuartz](https://www.xquartz.org/). Enable the `Allow connections from network clients` setting in the preferences (`Security` Tab).
- Run `docker-run-mac.sh roslaunch sample_applications sample_simple_simulation.launch`
## Requirements for development ## Requirements for development
......
<?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"/>
#!/bin/sh
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" \
ceti-panda-gazebo-workspace \
"$@"
\ No newline at end of file
start config.xlaunch
docker build . -t ceti-panda-gazebo-workspace
docker run -it^
--env="DISPLAY=host.docker.internal:0"^
--user="ros"^
ceti-panda-gazebo-workspace^
%*
pause
\ 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 $HOME/devel/setup.bash
exec "$@"
\ No newline at end of file
#!/bin/sh
if [ -z "$(ls -A /root/Desktop/ros_ws)" ]; then
echo "Copying workspace..."
cp /root/ws_tmp/* /root/Desktop/ros_ws -r
chmod a+rwx /root/Desktop/ros_ws/ -R
fi
\ 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