diff --git a/Dockerfile b/Dockerfile index a85b62bf53250cf024635f70bb7d872be1db5915..f5a0b569ccb6b106e070bda6f603eb2a9a752c4f 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 0000000000000000000000000000000000000000..218a77d9aa767f2d33f7925f53877569dff87869 --- /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