Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfiles for fetch_gazebo #46

Closed
moriarty opened this issue Mar 19, 2019 · 3 comments
Closed

Dockerfiles for fetch_gazebo #46

moriarty opened this issue Mar 19, 2019 · 3 comments

Comments

@moriarty
Copy link
Contributor

moriarty commented Mar 19, 2019

This issue is more of a todo, I have a dockerfile which I've been using to test/debug #37 and should clean it up, and put it into this repository somewhere with a ReadMe and some instructions.

It can be passed arguments so that it works for Indigo/Kinetic/Melodic.

But it requires nvidia-docker2

ARG OPENGL_TAG=1.0-glvnd-devel-ubuntu16.04

FROM nvidia/opengl:${OPENGL_TAG}

ARG ROS_DISTRO
ARG GAZEBO_VERSION
ARG FETCH_ROS_VERSION

ENV ROS_DISTRO ${ROS_DISTRO:-kinetic}
ENV GAZEBO_VERSION ${GAZEBO_VERSION:-7}
ENV FETCH_ROS_VERSION ${FETCH_ROS_VERSION:-0.7.14}

# setup environment
ENV TERM xterm
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8

# nvidia-container-runtime
ENV NVIDIA_VISIBLE_DEVICES \
    ${NVIDIA_VISIBLE_DEVICES:-all}
ENV NVIDIA_DRIVER_CAPABILITIES \
    ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics

# install packages
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get install -q -y \
      dirmngr \
      gnupg2 \
      lsb-release && \
    rm -rf /var/lib/apt/lists/*

# setup keys
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 \
      --recv-keys 421C365BD9FF1F717815A3895523BAEEB01FA116

# setup sources.list
RUN echo "deb http://packages.ros.org/ros/ubuntu `lsb_release -sc` main" > \
      /etc/apt/sources.list.d/ros-latest.list

# install bootstrap tools
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get install --no-install-recommends -y \
      python-rosdep \
      python-rosinstall \
      python-vcstools && \
    rm -rf /var/lib/apt/lists/*

# bootstrap rosdep
RUN rosdep init \
    && rosdep update

# install ros packages
RUN DEBIAN_FRONTEND=noninteractive apt-get update && \
    apt-get install -y \
      build-essential \ 
      git \
      ros-${ROS_DISTRO}-desktop-full \
      python-catkin-tools \
      vim && \
    rm -rf /var/lib/apt/lists/*

RUN mkdir -p ros/${ROS_DISTRO}/src && \
    cd ros/${ROS_DISTRO} && \
    catkin config --init && \
    catkin config --extend /opt/ros/${ROS_DISTRO} && \
    cd src && \
    git clone --branch gazebo${GAZEBO_VERSION} https://github.com/fetchrobotics/fetch_gazebo.git && \
    git clone --branch ${FETCH_ROS_VERSION} https://github.com/fetchrobotics/fetch_ros.git && \
    cd ../ && \
    DEBIAN_FRONTEND=noninteractive apt-get update && \
    rosdep install -y --from-paths src --ignore-src \
      --rosdistro ${ROS_DISTRO} && \
    rm -rf /var/lib/apt/lists/*

RUN cd /ros/${ROS_DISTRO} && \
    catkin_make_isolated
@moriarty
Copy link
Contributor Author

FROM osrf/ros:melodic-desktop-full-bionic

RUN DEBIAN_FRONTEND=noninteractive apt-get update \
 && apt-get install -y -q --no-install-recommends \
    python-catkin-tools \
    python-rosinstall-generator \
 && . /opt/ros/melodic/setup.sh \
 && rosinstall_generator fetchit_challenge --deps --deps-only --exclude RPP > stable.rosinstall \
 && rosinstall_generator fetchit_challenge --upstream > active.rosinstall \
 && mkdir -p $HOME/ros/stable $HOME/ros/active \
 && wstool init $HOME/ros/stable/src stable.rosinstall \
 && wstool init $HOME/ros/active/src active.rosinstall \
 && cd $HOME/ros/stable \
    && catkin config --init \
    && catkin config --install --extend /opt/ros/melodic \
    && catkin build \
 && cd $HOME/ros/active \
    && catkin config --init \
    && catkin config --extend $HOME/ros/stable/install \
    && catkin build \
 && sed -i 's/\/opt\/ros\/\$ROS_DISTRO/\$HOME\/ros\/active\/devel/' /ros_entrypoint.sh

ENTRYPOINT ["/ros_entrypoint.sh"]
CMD ["bash"]

@moriarty
Copy link
Contributor Author

For those who are participating in FetchIt! you'll notice an error in the version I sent around via e-mail.

-  && sed -i 's/\/opt\/ros\/\$ROS_DISTRO/\$HOME\/ros\/active\/devel/' ./ros_entrypoint.sh
+  && sed -i 's/\/opt\/ros\/\$ROS_DISTRO/\$HOME\/ros\/active\/devel/' /ros_entrypoint.sh

@moriarty
Copy link
Contributor Author

#75 and this are essentially duplicates.

The Dockerfiles in the comments above no longer work, ros is now in the official docker images: osrf/ros -> ros

FROM ros:melodic

These are still on the todo list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant