Skip to content

Commit e949a66

Browse files
committed
containers base/nuttx use PX4 setup script
1 parent 303ccdf commit e949a66

File tree

4 files changed

+56
-154
lines changed

4 files changed

+56
-154
lines changed

docker/Dockerfile_base-bionic

Lines changed: 14 additions & 52 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 \
@@ -100,6 +54,14 @@ RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4
10054
&& gradle install \
10155
&& rm -rf /tmp/*
10256

57+
# cleanup
58+
RUN rm -rf \
59+
/var/lib/apt/lists/* \
60+
/tmp/* /var/tmp/* \
61+
/root/.cache \
62+
/root/.gradle \
63+
/root/.local \
64+
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
10567

docker/Dockerfile_base-focal

Lines changed: 14 additions & 52 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 \
@@ -108,6 +62,14 @@ RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4
10862
&& gradle install \
10963
&& rm -rf /tmp/*
11064

65+
# cleanup
66+
RUN rm -rf \
67+
/var/lib/apt/lists/* \
68+
/tmp/* /var/tmp/* \
69+
/root/.cache \
70+
/root/.gradle \
71+
/root/.local \
72+
11173
# create user with id 1001 (jenkins docker workflow default)
11274
RUN useradd --shell /bin/bash -u 1001 -c "" -m user && usermod -a -G dialout user
11375

docker/Dockerfile_nuttx-bionic

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,17 @@
55
FROM px4io/px4-dev-base-bionic:2020-06-28
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: 9-2020-q2-update Released: June 30, 2020
29-
RUN mkdir -p /opt/gcc && cd /opt/gcc \
30-
&& wget -qO- "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-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 \
@@ -47,3 +27,12 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
4727
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
4828
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
4929
&& rm -rf /tmp/*
30+
31+
# cleanup
32+
RUN rm -rf \
33+
/var/lib/apt/lists/* \
34+
/tmp/* /var/tmp/* \
35+
/root/.cache \
36+
/root/.gradle \
37+
/root/.local
38+

docker/Dockerfile_nuttx-focal

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,37 +5,17 @@
55
FROM px4io/px4-dev-base-focal:2020-06-28
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: 9-2020-q2-update Released: June 30, 2020
29-
RUN mkdir -p /opt/gcc && cd /opt/gcc \
30-
&& wget -qO- "https://developer.arm.com/-/media/Files/downloads/gnu-rm/9-2020q2/gcc-arm-none-eabi-9-2020-q2-update-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 \
@@ -47,3 +27,12 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
4727
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
4828
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
4929
&& rm -rf /tmp/*
30+
31+
# cleanup
32+
RUN rm -rf \
33+
/var/lib/apt/lists/* \
34+
/tmp/* /var/tmp/* \
35+
/root/.cache \
36+
/root/.gradle \
37+
/root/.local
38+

0 commit comments

Comments
 (0)