Skip to content

Commit 3773008

Browse files
committed
containers base/nuttx use PX4 setup script
1 parent 9522fd4 commit 3773008

File tree

4 files changed

+46
-170
lines changed

4 files changed

+46
-170
lines changed

docker/Dockerfile_base-bionic

Lines changed: 21 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,25 @@ ENV LANG C.UTF-8
1010
ENV LC_ALL C.UTF-8
1111

1212
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
13-
bzip2 \
1413
ca-certificates \
15-
ccache \
16-
cmake \
17-
cppcheck \
1814
curl \
15+
default-jdk-headless \
1916
dirmngr \
20-
doxygen \
21-
file \
22-
g++ \
23-
gcc \
24-
gdb \
25-
git \
2617
gnupg \
2718
gosu \
28-
lcov \
2919
libfreetype6-dev \
30-
libgtest-dev \
3120
libpng-dev \
3221
libssl-dev \
3322
lsb-release \
34-
make \
35-
ninja-build \
36-
openjdk-8-jdk \
37-
openjdk-8-jre \
38-
openssh-client \
39-
pkg-config \
40-
python3-dev \
41-
python3-pip \
42-
rsync \
43-
shellcheck \
4423
tzdata \
45-
unzip \
46-
valgrind \
4724
wget \
48-
xsltproc \
49-
zip \
25+
&& cd /tmp \
26+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
27+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
28+
&& bash ubuntu.sh --no-nuttx --no-sim-tools \
5029
&& apt-get -y autoremove \
5130
&& apt-get clean autoclean \
52-
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
53-
54-
# gtest
55-
RUN cd /usr/src/gtest \
56-
&& mkdir build && cd build \
57-
&& cmake .. && make -j$(nproc) \
58-
&& cp *.a /usr/lib \
59-
&& cd .. && rm -rf build
60-
61-
# Install Python 3 pip build dependencies first.
62-
RUN pip3 install wheel setuptools
63-
64-
# Python 3 dependencies installed by pip
65-
RUN pip3 install argparse argcomplete coverage cerberus empy jinja2 \
66-
matplotlib==3.0.* numpy packaging pkgconfig pyros-genmsg pyulog \
67-
pyyaml requests serial six toml psutil pyulog wheel
68-
69-
# manual ccache setup
70-
RUN ln -s /usr/bin/ccache /usr/lib/ccache/cc \
71-
&& ln -s /usr/bin/ccache /usr/lib/ccache/c++
72-
73-
# astyle v3.1
74-
RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz -O /tmp/astyle.tar.gz \
75-
&& cd /tmp && tar zxf astyle.tar.gz && cd astyle/src \
76-
&& make -f ../build/gcc/Makefile -j$(nproc) && cp bin/astyle /usr/local/bin \
77-
&& rm -rf /tmp/*
31+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7832

7933
# Gradle (Required to build Fast-RTPS-Gen)
8034
RUN wget -q "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip" -O /tmp/gradle-6.3-rc-4-bin.zip \
@@ -85,20 +39,28 @@ RUN wget -q "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip"
8539

8640
ENV PATH "/opt/gradle/gradle-6.3-rc-4/bin:$PATH"
8741

88-
# Fast-RTPS 1.8.2
89-
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS.git -b v1.8.2 /tmp/FastRTPS-1.8.2 \
90-
&& cd /tmp/FastRTPS-1.8.2 \
42+
# Intall foonathan_memory from source as it is required to Fast-RTPS >= 1.9
43+
RUN git clone https://github.com/eProsima/foonathan_memory_vendor.git /tmp/foonathan_memory \
44+
&& cd /tmp/foonathan_memory \
45+
&& mkdir build && cd build \
46+
&& cmake .. \
47+
&& cmake --build . --target install -- -j $(nproc) \
48+
&& rm -rf /tmp/foonathan_memory
49+
50+
# Fast-RTPS 1.9.4
51+
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS.git -b v1.9.4 /tmp/FastRTPS \
52+
&& cd /tmp/FastRTPS \
9153
&& mkdir build && cd build \
9254
&& cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \
9355
&& cmake --build . --target install -- -j $(nproc) \
94-
&& rm -rf /tmp/*
56+
&& rm -rf /tmp/FastRTPS
9557

9658
# Fast-RTPS-Gen 1.0.4
97-
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen-1.0.4 \
98-
&& cd /tmp/Fast-RTPS-Gen-1.0.4 \
59+
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen \
60+
&& cd /tmp/Fast-RTPS-Gen \
9961
&& gradle assemble \
10062
&& gradle install \
101-
&& rm -rf /tmp/*
63+
&& rm -rf /tmp/Fast-RTPS-Gen
10264

10365
# create user with id 1001 (jenkins docker workflow default)
10466
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user

docker/Dockerfile_base-focal

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -10,71 +10,25 @@ ENV LANG C.UTF-8
1010
ENV LC_ALL C.UTF-8
1111

1212
RUN apt-get update && apt-get -y --quiet --no-install-recommends install \
13-
bzip2 \
1413
ca-certificates \
15-
ccache \
16-
cmake \
17-
cppcheck \
1814
curl \
15+
default-jdk-headless \
1916
dirmngr \
20-
doxygen \
21-
file \
22-
g++ \
23-
gcc \
24-
gdb \
25-
git \
2617
gnupg \
2718
gosu \
28-
lcov \
2919
libfreetype6-dev \
30-
libgtest-dev \
3120
libpng-dev \
3221
libssl-dev \
3322
lsb-release \
34-
make \
35-
ninja-build \
36-
openjdk-8-jdk \
37-
openjdk-8-jre \
38-
openssh-client \
39-
pkg-config \
40-
python3-dev \
41-
python3-pip \
42-
rsync \
43-
shellcheck \
4423
tzdata \
45-
unzip \
46-
valgrind \
4724
wget \
48-
xsltproc \
49-
zip \
25+
&& cd /tmp \
26+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
27+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
28+
&& bash ubuntu.sh --no-nuttx --no-sim-tools \
5029
&& apt-get -y autoremove \
5130
&& apt-get clean autoclean \
52-
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
53-
54-
# gtest
55-
RUN cd /usr/src/gtest \
56-
&& mkdir build && cd build \
57-
&& cmake .. && make -j$(nproc) \
58-
&& find . -name \*.a -exec cp {} /usr/lib \; \
59-
&& cd .. && rm -rf build
60-
61-
# Install Python 3 pip build dependencies first.
62-
RUN python3 -m pip install --upgrade pip wheel setuptools
63-
64-
# Python 3 dependencies installed by pip
65-
RUN python3 -m pip install argparse argcomplete coverage cerberus empy jinja2 \
66-
matplotlib==3.0.* numpy packaging pkgconfig pyros-genmsg pyulog \
67-
pyyaml requests serial six toml psutil pyulog wheel
68-
69-
# manual ccache setup
70-
RUN ln -s /usr/bin/ccache /usr/lib/ccache/cc \
71-
&& ln -s /usr/bin/ccache /usr/lib/ccache/c++
72-
73-
# astyle v3.1
74-
RUN wget -q https://downloads.sourceforge.net/project/astyle/astyle/astyle%203.1/astyle_3.1_linux.tar.gz -O /tmp/astyle.tar.gz \
75-
&& cd /tmp && tar zxf astyle.tar.gz && cd astyle/src \
76-
&& make -f ../build/gcc/Makefile -j$(nproc) && cp bin/astyle /usr/local/bin \
77-
&& rm -rf /tmp/*
31+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
7832

7933
# Gradle (Required to build Fast-RTPS-Gen)
8034
RUN wget -q "https://services.gradle.org/distributions/gradle-6.3-rc-4-bin.zip" -O /tmp/gradle-6.3-rc-4-bin.zip \
@@ -91,22 +45,22 @@ RUN git clone https://github.com/eProsima/foonathan_memory_vendor.git /tmp/foona
9145
&& mkdir build && cd build \
9246
&& cmake .. \
9347
&& cmake --build . --target install -- -j $(nproc) \
94-
&& rm -rf /tmp/*
48+
&& rm -rf /tmp/foonathan_memory
9549

9650
# Fast-RTPS 1.9.4
97-
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS.git -b v1.9.4 /tmp/FastRTPS-1.9.4 \
98-
&& cd /tmp/FastRTPS-1.9.4 \
51+
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS.git -b v1.9.4 /tmp/FastRTPS \
52+
&& cd /tmp/FastRTPS \
9953
&& mkdir build && cd build \
10054
&& cmake -DTHIRDPARTY=ON -DSECURITY=ON .. \
10155
&& cmake --build . --target install -- -j $(nproc) \
102-
&& rm -rf /tmp/*
56+
&& rm -rf /tmp/FastRTPS
10357

10458
# Fast-RTPS-Gen 1.0.4
105-
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen-1.0.4 \
106-
&& cd /tmp/Fast-RTPS-Gen-1.0.4 \
59+
RUN git clone --recursive https://github.com/eProsima/Fast-RTPS-Gen.git -b v1.0.4 /tmp/Fast-RTPS-Gen \
60+
&& cd /tmp/Fast-RTPS-Gen \
10761
&& gradle assemble \
10862
&& gradle install \
109-
&& rm -rf /tmp/*
63+
&& rm -rf /tmp/Fast-RTPS-Gen
11064

11165
# create user with id 1001 (jenkins docker workflow default)
11266
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user

docker/Dockerfile_nuttx-bionic

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,20 @@
22
# PX4 NuttX development environment in Ubuntu 18.04 Bionic
33
#
44

5-
FROM px4io/px4-dev-base-bionic:2020-06-20
5+
FROM px4io/px4-dev-base-bionic:2020-06-23
66
LABEL maintainer="Daniel Agar <daniel@agar.ca>"
77

8-
RUN apt-get update \
9-
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
10-
autoconf \
11-
automake \
12-
bison \
13-
build-essential \
14-
bzip2 \
15-
file \
16-
flex \
17-
genromfs \
18-
gperf \
19-
libncurses-dev \
20-
libtool \
21-
pkg-config \
22-
uncrustify \
23-
vim-common \
8+
RUN cd /tmp \
9+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
10+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
11+
&& bash ubuntu.sh --no-sim-tools \
2412
&& apt-get -y autoremove \
2513
&& apt-get clean autoclean \
26-
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27-
28-
# GNU Arm Embedded Toolchain Version 9-2019-q4-major Released: November 06, 2019
29-
RUN mkdir -p /opt/gcc && cd /opt/gcc \
30-
&& wget -qO- "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2" | tar jx --strip 1 \
14+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3115
&& rm -rf /opt/gcc/share/doc
3216

3317
ENV PATH="$PATH:/opt/gcc/bin"
3418

35-
# manual ccache setup for arm-none-eabi-g++/arm-none-eabi-gcc
36-
RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \
37-
&& ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc
38-
3919
# nuttx tools
4020
RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
4121
&& cd /tmp/tools/kconfig-frontends \

docker/Dockerfile_nuttx-focal

Lines changed: 6 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,40 +2,20 @@
22
# PX4 NuttX development environment in Ubuntu 20.04 Focal
33
#
44

5-
FROM px4io/px4-dev-base-focal:2020-06-20
5+
FROM px4io/px4-dev-base-focal:2020-06-23
66
LABEL maintainer="Daniel Agar <daniel@agar.ca>"
77

8-
RUN apt-get update \
9-
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
10-
autoconf \
11-
automake \
12-
bison \
13-
build-essential \
14-
bzip2 \
15-
file \
16-
flex \
17-
genromfs \
18-
gperf \
19-
libncurses-dev \
20-
libtool \
21-
pkg-config \
22-
uncrustify \
23-
vim-common \
8+
RUN cd /tmp \
9+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
10+
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
11+
&& bash ubuntu.sh --no-sim-tools \
2412
&& apt-get -y autoremove \
2513
&& apt-get clean autoclean \
26-
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*
27-
28-
# GNU Arm Embedded Toolchain Version 9-2019-q4-major Released: November 06, 2019
29-
RUN mkdir -p /opt/gcc && cd /opt/gcc \
30-
&& wget -qO- "https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux.tar.bz2" | tar jx --strip 1 \
14+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3115
&& rm -rf /opt/gcc/share/doc
3216

3317
ENV PATH="$PATH:/opt/gcc/bin"
3418

35-
# manual ccache setup for arm-none-eabi-g++/arm-none-eabi-gcc
36-
RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \
37-
&& ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc
38-
3919
# nuttx tools
4020
RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
4121
&& cd /tmp/tools/kconfig-frontends \

0 commit comments

Comments
 (0)