-
Notifications
You must be signed in to change notification settings - Fork 30
/
Dockerfile
106 lines (77 loc) · 4.89 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
FROM ubuntu:xenial
MAINTAINER William Woodall <william@osrfoundation.org>
ARG BRIDGE=false
ARG PLATFORM=x86
# Prevent errors from apt-get.
# See: http://askubuntu.com/questions/506158/unable-to-initialize-frontend-dialog-when-using-ssh
ENV DEBIAN_FRONTEND noninteractive
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
RUN apt-get update && apt-get install -y lsb-release
RUN apt-get update && apt-get install -y sudo
# Get curl for fetching the repo keys.
RUN apt-get update && apt-get install -y curl
# Get https transport for APT.
RUN apt-get update && apt-get install -y apt-transport-https
# Add the ROS repositories to the apt sources list.
RUN echo "deb http://repositories.ros.org/ubuntu/testing/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list
RUN curl --silent http://repositories.ros.org/repos.key | apt-key add -
# Add the OSRF repositories to the apt sources list.
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list
RUN curl --silent http://packages.osrfoundation.org/gazebo.key | apt-key add -
# Add the Git-LFS repository.
RUN echo "platform: ${PLATFORM}"
RUN if test ${PLATFORM} = x86; then echo "deb https://packagecloud.io/github/git-lfs/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/github_git-lfs.list; fi
RUN if test ${PLATFORM} = x86; then curl --silent https://packagecloud.io/gpg.key | apt-key add -; fi
# Install some development tools.
RUN apt-get update && apt-get install -y build-essential ccache cmake pkg-config python3-empy python3-setuptools python3-vcstool
# Install build and test dependencies of ROS 2 packages.
RUN apt-get update && apt-get install -y clang-format-3.8 cppcheck git pydocstyle pyflakes python3-coverage python3-flake8 python3-mock python3-nose python3-pep8 uncrustify
# Install and self update pip/setuptools to the latest version.
RUN apt-get update && apt-get install -y python3-pip
RUN pip3 install -U setuptools pip virtualenv
# Install coverage build dependencies.
RUN apt-get update && apt-get install -y gcovr
# Install the OpenSplice binary from the OSRF repositories.
RUN if test ${PLATFORM} = x86; then apt-get update && apt-get install -y libopensplice64; fi
# Update default domain id.
RUN if test ${PLATFORM} = x86; then sed -i "s/<Id>0<\/Id>/<Id>108<\/Id>/" /usr/etc/opensplice/config/ospl.xml; fi
# Install the RTI dependencies.
RUN if test ${PLATFORM} = x86; then apt-get update && apt-get install -y default-jre-headless; fi
# Install dependencies for RTI web binaries install script.
RUN pip3 install pexpect
# Get and install the RTI web binaries.
RUN curl --silent http://s3.amazonaws.com/RTI/Bundles/5.2.3/Evaluation/rti_connext_dds-5.2.3-eval-x64Linux3gcc4.8.2.run -o /tmp/rti-installer.run && chmod +x /tmp/rti-installer.run
ADD rti_web_binaries_install_script.py /tmp/rti_web_binaries_install_script.py
# Add the RTI license file.
ADD rticonnextdds-license/rti_license.dat /tmp/rti_license.dat
# Add the RTI binaries we made.
ADD rticonnextdds-src/librticonnextdds52_5.2.3-1_amd64.deb /tmp/librticonnextdds52_5.2.3-1_amd64.deb
ADD rticonnextdds-src/librticonnextdds52-dev_5.2.3-1_amd64.deb /tmp/librticonnextdds52-dev_5.2.3-1_amd64.deb
ADD rticonnextdds-src/rticonnextdds-tools_5.2.3-1_amd64.deb /tmp/rticonnextdds-tools_5.2.3-1_amd64.deb
# Install the eProsima dependencies.
RUN apt-get update && apt-get install -y libboost-chrono-dev libboost-date-time-dev libboost-program-options-dev libboost-regex-dev libboost-system-dev libboost-thread-dev valgrind
# Install OpenCV.
RUN apt-get update && apt-get install -y libopencv-dev
# Install build dependencies for class loader.
RUN apt-get update && apt-get install -y libpoco-dev libpocofoundation9v5 libpocofoundation9v5-dbg
# Install Git-LFS.
RUN if test ${PLATFORM} = x86; then apt-get update && apt-get install -y git-lfs; fi
# Install Python3 development files.
RUN apt-get update && apt-get install -y python3-dev
# automatic invalidation once every day.
RUN echo "@today_str"
# Install build and test dependencies of ros1_bridge.
RUN if test ${BRIDGE} = true; then apt-get update && apt-get install -y python-rospkg ros-kinetic-catkin ros-kinetic-common-msgs ros-kinetic-rosbash ros-kinetic-roscpp ros-kinetic-roslaunch ros-kinetic-rosmsg ros-kinetic-roscpp-tutorials ros-kinetic-rospy-tutorials; fi
# Create a user to own the build output.
RUN useradd -u 1234 -m rosbuild
RUN sudo -H -u rosbuild -- git config --global user.email "jenkins@ci.ros2.org"
RUN sudo -H -u rosbuild -- git config --global user.name "Jenkins ROS 2"
RUN echo 'rosbuild ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
WORKDIR /home/rosbuild
# Add an entry point which changes rosbuild's UID from 1234 to the UID of the invoking user.
# This means that the generated files will have the same ownership as the host OS user.
ADD entry_point.sh /entry_point.sh
RUN chmod 755 /entry_point.sh
ENTRYPOINT ["/entry_point.sh"]
CMD ["python3 -u run_ros2_batch.py $CI_ARGS"]