From 48357d8df8652672fa5f28aa61ef7078f9b2e15a Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Mon, 28 Jan 2019 10:23:26 -0600 Subject: [PATCH] Dockerfile and supporting scripts for building ign-gazebo The scripts are split out so that they could potentially be used by other build pipelines (such as bitbucket or jenkins) and have the changes reflected everywhere they are used. --- .dockerignore | 2 + docker/Dockerfile.nightly | 45 +++++++++++++++++ docker/scripts/enable_gcc8.sh | 17 +++++++ docker/scripts/enable_ign_nightly.sh | 8 +++ docker/scripts/enable_ign_prerelease.sh | 8 +++ docker/scripts/enable_ign_stable.sh | 7 +++ docker/scripts/install_common_deps.sh | 31 ++++++++++++ docker/scripts/install_ign_deps.sh | 66 +++++++++++++++++++++++++ 8 files changed, 184 insertions(+) create mode 100644 .dockerignore create mode 100644 docker/Dockerfile.nightly create mode 100755 docker/scripts/enable_gcc8.sh create mode 100755 docker/scripts/enable_ign_nightly.sh create mode 100755 docker/scripts/enable_ign_prerelease.sh create mode 100755 docker/scripts/enable_ign_stable.sh create mode 100755 docker/scripts/install_common_deps.sh create mode 100755 docker/scripts/install_ign_deps.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..2286ab6ad9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +build +build_* diff --git a/docker/Dockerfile.nightly b/docker/Dockerfile.nightly new file mode 100644 index 0000000000..28df4efa9c --- /dev/null +++ b/docker/Dockerfile.nightly @@ -0,0 +1,45 @@ +FROM ubuntu:bionic + +RUN apt-get update \ + && apt-get install -y \ + sudo \ + && apt-get clean + +COPY docker/scripts/install_common_deps.sh scripts/install_common_deps.sh +RUN scripts/install_common_deps.sh + +# This is not strictly necessary, but makes things faster down the line. +COPY docker/scripts/install_ign_deps.sh scripts/install_ign_deps.sh +RUN scripts/install_ign_deps.sh + +COPY docker/scripts/enable_gcc8.sh scripts/enable_gcc8.sh +RUN scripts/enable_gcc8.sh + +COPY docker/scripts/enable_ign_stable.sh scripts/enable_ign_stable.sh +RUN scripts/enable_ign_stable.sh + +COPY docker/scripts/enable_ign_prerelease.sh scripts/enable_ign_prerelease.sh +RUN scripts/enable_ign_prerelease.sh + +COPY docker/scripts/enable_ign_nightly.sh scripts/enable_ign_nightly.sh +RUN scripts/enable_ign_nightly.sh + +RUN apt-get update \ + && apt-get install -y \ + libignition-cmake2-dev \ + libignition-common3-dev \ + libignition-math6-eigen3-dev \ + libignition-plugin-dev \ + libignition-physics-dev \ + libignition-rendering-dev \ + libignition-tools-dev \ + libignition-transport6-dev \ + libignition-gui-dev \ + libignition-msgs3-dev \ + libignition-sensors-dev \ + libsdformat8-dev + +COPY . ign-gazebo +RUN cd ign-gazebo \ + && ./docker/scripts/build_ign_gazebo.sh + diff --git a/docker/scripts/enable_gcc8.sh b/docker/scripts/enable_gcc8.sh new file mode 100755 index 0000000000..79524f5f8d --- /dev/null +++ b/docker/scripts/enable_gcc8.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo apt-get install g++-8 + +sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8 + +gcc -v +g++ -v +gcov -v + +# lcov +git clone https://github.com/linux-test-project/lcov.git +cd lcov +sudo make install diff --git a/docker/scripts/enable_ign_nightly.sh b/docker/scripts/enable_ign_nightly.sh new file mode 100755 index 0000000000..727cc2e331 --- /dev/null +++ b/docker/scripts/enable_ign_nightly.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-nightly `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-nightly.list + +wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - diff --git a/docker/scripts/enable_ign_prerelease.sh b/docker/scripts/enable_ign_prerelease.sh new file mode 100755 index 0000000000..17e8862c29 --- /dev/null +++ b/docker/scripts/enable_ign_prerelease.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-prerelease `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-prerelease.list + +wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - diff --git a/docker/scripts/enable_ign_stable.sh b/docker/scripts/enable_ign_stable.sh new file mode 100755 index 0000000000..d509044dd9 --- /dev/null +++ b/docker/scripts/enable_ign_stable.sh @@ -0,0 +1,7 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list +wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - diff --git a/docker/scripts/install_common_deps.sh b/docker/scripts/install_common_deps.sh new file mode 100755 index 0000000000..16846caeb5 --- /dev/null +++ b/docker/scripts/install_common_deps.sh @@ -0,0 +1,31 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo apt-get update + +sudo apt-get install -y \ + gnupg \ + lsb-release \ + software-properties-common \ + wget + +sudo apt-get install -y \ + build-essential \ + cmake \ + curl \ + git \ + g++-8 \ + mercurial \ + pkg-config + +sudo apt-get install -y \ + cppcheck \ + valgrind + +sudo apt-get install -y \ + python3 \ + python3-dbg \ + python3-pip \ + python3-venv diff --git a/docker/scripts/install_ign_deps.sh b/docker/scripts/install_ign_deps.sh new file mode 100755 index 0000000000..fa9c0c63f6 --- /dev/null +++ b/docker/scripts/install_ign_deps.sh @@ -0,0 +1,66 @@ +#!/bin/bash + +set -o errexit +set -o verbose + +sudo apt-get update + +# Things that are used all over the ign stack +sudo apt-get install -y \ + doxygen \ + libboost-all-dev \ + libbullet-dev \ + libeigen3-dev \ + libgflags-dev \ + libtinyxml2-dev \ + libprotoc-dev libprotobuf-dev \ + protobuf-compiler \ + ruby-ronn \ + ruby-dev \ + swig \ + uuid-dev + +# ign-common dependencies +sudo apt-get install -y \ + libavcodec-dev \ + libavdevice-dev \ + libavformat-dev \ + libavutil-dev \ + libfreeimage-dev \ + libgts-dev \ + libswscale-dev + +# ign-gui dependencies +sudo apt-get install -y \ + qtbase5-dev \ + qtdeclarative5-dev \ + qtquickcontrols2-5-dev \ + qml-module-qtquick2 \ + qml-module-qtquick-controls \ + qml-module-qtquick-controls2 \ + qml-module-qtquick-dialogs \ + qml-module-qtquick-layouts \ + qml-module-qt-labs-folderlistmodel \ + qml-module-qt-labs-settings \ + qml-module-qtgraphicaleffects + +# ign-rendering dependencies +sudo apt-get install -y \ + libogre-1.9-dev \ + libglew-dev \ + libfreeimage-dev \ + freeglut3-dev \ + libxmu-dev \ + libxi-dev + +# ign-transport dependencies +sudo apt-get install -y \ + libzmq3-dev \ + libsqlite3-dev + +# SDFormat dependencies +sudo apt-get install -y \ + libxml2-dev + +sudo apt-get clean +