Created
July 14, 2020 01:24
-
-
Save ruffsl/e2c802848671c91155073a18181d6d39 to your computer and use it in GitHub Desktop.
Gazebo9 source build with DART and ROS1 Melodic
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ARG FROM_IMAGE=ros:melodic | |
ARG UNDERLAY_WS=/opt/underlay_ws | |
# multi-stage for caching | |
FROM $FROM_IMAGE AS cacher | |
# install helper packages | |
RUN apt-get update && apt-get install -y \ | |
curl \ | |
git \ | |
python3-vcstool \ | |
&& rm -rf /var/lib/apt/lists/* | |
# clone underlay source | |
ARG UNDERLAY_WS | |
WORKDIR $UNDERLAY_WS/src | |
COPY ./underlay.repos ../ | |
RUN vcs import ./ < ../underlay.repos && \ | |
find ./ -name ".git" | xargs rm -rf && \ | |
curl https://bitbucket.org/scpeters/unix-stuff/raw/master/package_xml/package_gazebo.xml > osrf/gazebo/package.xml | |
# copy manifests for caching | |
WORKDIR /opt | |
RUN mkdir -p /tmp/opt && \ | |
find ./ -name "package.xml" | \ | |
xargs cp --parents -t /tmp/opt && \ | |
find ./ -name "COLCON_IGNORE" | \ | |
xargs cp --parents -t /tmp/opt || true | |
# multi-stage for building | |
FROM $FROM_IMAGE AS builder | |
# install dev packages | |
RUN apt-get update && apt-get install -y \ | |
build-essential \ | |
ccache \ | |
lcov \ | |
lsb-release \ | |
python3-colcon-common-extensions \ | |
python3-colcon-mixin \ | |
python-rosdep \ | |
software-properties-common \ | |
&& rosdep update \ | |
&& rm -rf /var/lib/apt/lists/* | |
# setup colcon mixin and metadata | |
RUN colcon mixin add default \ | |
https://raw.githubusercontent.com/colcon/colcon-mixin-repository/master/index.yaml && \ | |
colcon mixin update && \ | |
colcon metadata add default \ | |
https://raw.githubusercontent.com/colcon/colcon-metadata-repository/master/index.yaml && \ | |
colcon metadata update | |
# setup keys | |
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys D2486D2DD83DB69272AFE98867170598AF249743 | |
# setup sources.list | |
RUN . /etc/os-release \ | |
&& echo "deb http://packages.osrfoundation.org/gazebo/$ID-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-latest.list | |
# install dart packages | |
RUN apt-add-repository ppa:dartsim/ppa && \ | |
apt-get update && apt-get install -y \ | |
libdart6-dev \ | |
libdart6-utils-urdf-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# install gazebo packages | |
RUN apt-get update && apt-get install -q -y --no-install-recommends \ | |
libgazebo9-dev \ | |
libtinyxml2-dev \ | |
protobuf-compiler \ | |
ruby-ronn \ | |
xsltproc \ | |
libqt5opengl5-dev \ | |
&& rm -rf /var/lib/apt/lists/* | |
# install underlay dependencies | |
ARG UNDERLAY_WS | |
WORKDIR $UNDERLAY_WS | |
# COPY --from=cacher /tmp/$UNDERLAY_WS ./ | |
# RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | |
# apt-get update && rosdep install -q -y \ | |
# --from-paths src \ | |
# --ignore-src \ | |
# --skip-keys " \ | |
# simbody \ | |
# " \ | |
# && rm -rf /var/lib/apt/lists/* | |
# build underlay source | |
COPY --from=cacher $UNDERLAY_WS ./ | |
ARG UNDERLAY_MIXINS="release ccache" | |
ARG FAIL_ON_BUILD_FAILURE=True | |
RUN . /opt/ros/$ROS_DISTRO/setup.sh && \ | |
colcon build \ | |
--symlink-install \ | |
--mixin $UNDERLAY_MIXINS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
repositories: | |
osrf/gazebo: | |
type: git | |
url: https://github.com/osrf/gazebo.git | |
version: gazebo9 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment