-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
189 lines (161 loc) · 5.25 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
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
#
# PX4 base development environment
#
FROM ubuntu:20.04 AS px4-dev-base-focal
LABEL maintainer="Daniel Agar <[email protected]>"
ENV DEBIAN_FRONTEND noninteractive
ENV LANG C.UTF-8
ENV LC_ALL C.UTF-8
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
bzip2 \
ca-certificates \
ccache \
cmake \
cppcheck \
curl \
dirmngr \
doxygen \
file \
g++ \
gcc \
gdb \
git \
gnupg \
gosu \
lcov \
libfreetype6-dev \
libgtest-dev \
libpng-dev \
libssl-dev \
lsb-release \
make \
ninja-build \
openjdk-8-jdk \
openjdk-8-jre \
openssh-client \
pkg-config \
python3-dev \
python3-pip \
rsync \
shellcheck \
tzdata \
unzip \
valgrind \
wget \
xsltproc \
zip \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# gtest
RUN cd /usr/src/gtest \
&& mkdir build && cd build \
&& cmake .. && make -j$(nproc) \
&& find . -name \*.a -exec cp {} /usr/lib \; \
&& cd .. && rm -rf build
# Install Python 3 pip build dependencies first.
RUN python3 -m pip install --upgrade pip wheel setuptools
# Python 3 dependencies installed by pip
RUN python3 -m pip install argparse argcomplete coverage cerberus empy jinja2 kconfiglib \
matplotlib==3.0.* numpy nunavut>=1.1.0 packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel jsonschema pynacl
# manual ccache setup
RUN ln -s /usr/bin/ccache /usr/lib/ccache/cc \
&& ln -s /usr/bin/ccache /usr/lib/ccache/c++
# astyle v3.1
RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz -O /tmp/astyle.tar.gz \
&& cd /tmp && tar zxf astyle.tar.gz && cd astyle/src \
&& make -f ../build/gcc/Makefile -j$(nproc) && cp bin/astyle /usr/local/bin \
&& rm -rf /tmp/*
# Gradle (Required to build Fast-RTPS-Gen)
RUN wget -q "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip" -O /tmp/gradle-6.3-rc-4-bin.zip \
&& mkdir /opt/gradle \
&& cd /tmp \
&& unzip -d /opt/gradle gradle-6.3-rc-4-bin.zip \
&& rm -rf /tmp/*
ENV PATH "/opt/gradle/gradle-6.3-rc-4/bin:$PATH"
# Intall foonathan_memory from source as it is required to Fast-RTPS >= 1.9
RUN git clone https://github.com/eProsima/foonathan_memory_vendor.git /tmp/foonathan_memory \
&& cd /tmp/foonathan_memory \
&& mkdir build && cd build \
&& cmake .. \
&& cmake --build . --target install -- -j $(nproc) \
&& rm -rf /tmp/*
# Fast-DDS (Fast-RTPS 2.0.2)
RUN git clone --recursive https://github.com/eProsima/Fast-DDS.git -b v2.0.2 /tmp/FastDDS-2.0.2 \
&& cd /tmp/FastDDS-2.0.2 \
&& mkdir build && cd build \
&& cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \
&& cmake --build . --target install -- -j $(nproc) \
&& rm -rf /tmp/*
# Fast-RTPS-Gen 1.0.4
RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen-1.0.4 \
&& cd /tmp/Fast-RTPS-Gen-1.0.4 \
&& gradle assemble \
&& gradle install \
&& rm -rf /tmp/*
# create user with id 1001 (jenkins docker workflow default)
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
# setup virtual X server
RUN mkdir /tmp/.X11-unix && \
chmod 1777 /tmp/.X11-unix && \
chown -R root:root /tmp/.X11-unix
ENV DISPLAY :99
ENV CCACHE_UMASK=000
ENV FASTRTPSGEN_DIR="/usr/local/bin/"
ENV PATH="/usr/lib/ccache:$PATH"
ENV TERM=xterm
ENV TZ=UTC
# SITL UDP PORTS
EXPOSE 14556/udp
EXPOSE 14557/udp
# # create and start as LOCAL_USER_ID
# COPY ./entrypoint.sh /usr/local/bin/entrypoint.sh
# ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# CMD ["/bin/bash"]
##########################################################################################
#
# PX4 Gazebo 11 development environment in Ubuntu 20.04 Focal
#
FROM px4-dev-base-focal AS px4-dev-simulation-focal
LABEL maintainer="Nuno Marques <[email protected]>"
RUN wget --quiet http://packages.osrfoundation.org/gazebo.key -O - | apt-key add - \
&& sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -sc` main" > /etc/apt/sources.list.d/gazebo-stable.list' \
&& apt-get update --fix-missing \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
ant \
binutils \
bc \
dirmngr \
gazebo11 \
gstreamer1.0-plugins-bad \
gstreamer1.0-plugins-base \
gstreamer1.0-plugins-good \
gstreamer1.0-plugins-ugly \
libeigen3-dev \
libgazebo11-dev \
libgstreamer-plugins-base1.0-dev \
libimage-exiftool-perl \
libopencv-dev \
libxml2-utils \
mesa-utils \
protobuf-compiler \
x-window-system \
ignition-edifice \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
# Some QT-Apps/Gazebo don't not show controls without this
ENV QT_X11_NO_MITSHM 1
# Use UTF8 encoding in java tools (needed to compile jMAVSim)
ENV JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF8
# Install JSBSim
# RUN wget https://github.com/JSBSim-Team/jsbsim/releases/download/v1.1.1a/JSBSim-devel_1.1.1-134.focal.amd64.deb
# RUN dpkg -i JSBSim-devel_1.1.1-134.focal.amd64.deb
COPY ./pose /pose
RUN mkdir -p /pose/gazebo/build
WORKDIR /pose/gazebo/build
RUN cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ .. \
&& make \
&& mv ./send_drone_pose/send_drone_pose /usr/local/bin
WORKDIR /