From e06f7cae6ba47ae0801bac22415f04f1e89d652b Mon Sep 17 00:00:00 2001 From: Tim Kluge <timklge@gmail.com> Date: Fri, 28 Aug 2020 19:07:22 +0200 Subject: [PATCH] Add volume for workspace --- Dockerfile | 13 ++++++++----- vnc/copyws.sh | 7 +++++++ 2 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 vnc/copyws.sh diff --git a/Dockerfile b/Dockerfile index a85b62b..f5a0b56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,14 +3,17 @@ FROM fbottarel/ros-desktop-full-vnc:melodic RUN apt-get update && apt-get dist-upgrade -y RUN apt-get install -y \ ros-melodic-libfranka python-catkin-tools libeigen3-dev -#WORKDIR /src/ COPY ./vnc/simple_simulation.sh /root/Desktop/ RUN ln -s /usr/share/applications/lxterminal.desktop /root/Desktop/lxterminal.desktop -RUN chmod a+x /root/Desktop/simple_simulation.sh && mkdir /root/Desktop/ros_ws +RUN chmod a+x /root/Desktop/simple_simulation.sh && mkdir /root/ws_tmp ENV ROS_DISTRO=melodic -WORKDIR /root/Desktop/ros_ws -COPY ./src /root/Desktop/ros_ws/src +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 && apt-get clean RUN catkin config \ --extend /opt/ros/melodic && \ - catkin build \ No newline at end of file + catkin build +ENV OPENBOX_ARGS --startup "/root/copyws.sh" +VOLUME /root/Desktop/ros_ws diff --git a/vnc/copyws.sh b/vnc/copyws.sh new file mode 100644 index 0000000..218a77d --- /dev/null +++ b/vnc/copyws.sh @@ -0,0 +1,7 @@ +#!/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 -- GitLab