diff --git a/Dockerfile b/Dockerfile index 9746ef3..bc9cb9b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,19 +1,19 @@ ARG BASE_IMAGE +ARG ROS_DISTRO +FROM osrf/ros:${ROS_DISTRO}-desktop-full AS ros_distro FROM ${BASE_IMAGE} +ARG ROS_DISTRO # For this build, we pull the entire ros image, and then merge the filesystem # with the nvidia/opengl image, so that displaying to the screen on GPU # (or without GPU) works through docker. -# I was unable to use the ROS_DISTRO variable here due to this issue: -# https://github.com/docker/for-mac/issues/2155 -COPY --from=osrf/ros:melodic-desktop-full / / +COPY --from=ros_distro / / # Add ROS env vars to the bashrc ENV BASH_ENV="/root/launch.sh" SHELL ["/bin/bash", "-c"] ENTRYPOINT ["/bin/bash", "-c"] -ARG ROS_DISTRO RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> $BASH_ENV # Copy myCobot ROS package @@ -21,8 +21,8 @@ WORKDIR /catkin_ws/src COPY . mycobot_ros # Install build dependencies +RUN apt-get update && apt-get install -y curl RUN curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add - && \ - apt-get update && \ apt-get install -y \ # ROS Build dependencies python-rosinstall \ diff --git a/docker-compose.yml b/docker-compose.yml index fb75766..1b6775f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,7 +1,7 @@ version: '3.4' x-app: &common - command: [ "roslaunch mycobot_320 mycobot_320_slider.launch" ] + command: [ "roslaunch mycobot_280 slider_control.launch" ] privileged: true environment: PYTHONUNBUFFERED: 1 @@ -9,6 +9,7 @@ x-app: &common DISPLAY: $DISPLAY volumes: - "/tmp/.X11-unix:/tmp/.X11-unix:rw" + - ".:/catkin_ws/src/mycobot_ros" build: context: . args: &common-args