Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

containers base/nuttx use PX4 setup script #267

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 14 additions & 52 deletions docker/Dockerfile_base-bionic
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,25 @@ 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 \
default-jdk-headless \
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 \
&& cd /tmp \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
&& bash ubuntu.sh --no-nuttx --no-sim-tools \
&& 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) \
&& cp *.a /usr/lib \
&& cd .. && rm -rf build

# Install Python 3 pip build dependencies first.
RUN pip3 install wheel setuptools

# Python 3 dependencies installed by pip
RUN pip3 install argparse argcomplete coverage cerberus empy jinja2 \
matplotlib==3.0.* numpy packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel

# 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/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/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 \
Expand All @@ -100,6 +54,14 @@ RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4
&& gradle install \
&& rm -rf /tmp/*

# cleanup
RUN rm -rf \
/var/lib/apt/lists/* \
/tmp/* /var/tmp/* \
/root/.cache \
/root/.gradle \
/root/.local \

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

Expand Down
66 changes: 14 additions & 52 deletions docker/Dockerfile_base-focal
Original file line number Diff line number Diff line change
Expand Up @@ -10,71 +10,25 @@ 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 \
default-jdk-headless \
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 \
&& cd /tmp \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
&& bash ubuntu.sh --no-nuttx --no-sim-tools \
&& 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 \
matplotlib==3.0.* numpy packaging pkgconfig pyros-genmsg pyulog \
pyyaml requests serial six toml psutil pyulog wheel

# 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/*
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/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 \
Expand Down Expand Up @@ -108,6 +62,14 @@ RUN git clone --recursive https://github.com/eProsima/Fast-DDS-Gen.git -b v1.0.4
&& gradle install \
&& rm -rf /tmp/*

# cleanup
RUN rm -rf \
/var/lib/apt/lists/* \
/tmp/* /var/tmp/* \
/root/.cache \
/root/.gradle \
/root/.local \

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

Expand Down
39 changes: 14 additions & 25 deletions docker/Dockerfile_nuttx-bionic
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@
FROM px4io/px4-dev-base-bionic:2020-06-28
LABEL maintainer="Daniel Agar <[email protected]>"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
autoconf \
automake \
bison \
build-essential \
bzip2 \
file \
flex \
genromfs \
gperf \
libncurses-dev \
libtool \
pkg-config \
uncrustify \
vim-common \
RUN cd /tmp \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
&& bash ubuntu.sh --no-sim-tools \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*

# GNU Arm Embedded Toolchain: 9-2020-q2-update Released: June 30, 2020
RUN mkdir -p /opt/gcc && cd /opt/gcc \
&& 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 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /opt/gcc/share/doc

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

# manual ccache setup for arm-none-eabi-g++/arm-none-eabi-gcc
RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \
&& ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc

# nuttx tools
RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
&& cd /tmp/tools/kconfig-frontends \
Expand All @@ -47,3 +27,12 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
&& rm -rf /tmp/*

# cleanup
RUN rm -rf \
/var/lib/apt/lists/* \
/tmp/* /var/tmp/* \
/root/.cache \
/root/.gradle \
/root/.local

39 changes: 14 additions & 25 deletions docker/Dockerfile_nuttx-focal
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,17 @@
FROM px4io/px4-dev-base-focal:2020-06-28
LABEL maintainer="Daniel Agar <[email protected]>"

RUN apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get -y --quiet --no-install-recommends install \
autoconf \
automake \
bison \
build-essential \
bzip2 \
file \
flex \
genromfs \
gperf \
libncurses-dev \
libtool \
pkg-config \
uncrustify \
vim-common \
RUN cd /tmp \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/ubuntu.sh \
&& wget https://raw.githubusercontent.com/PX4/Firmware/master/Tools/setup/requirements.txt \
&& bash ubuntu.sh --no-sim-tools \
&& apt-get -y autoremove \
&& apt-get clean autoclean \
&& rm -rf /var/lib/apt/lists/{apt,dpkg,cache,log} /tmp/* /var/tmp/*

# GNU Arm Embedded Toolchain: 9-2020-q2-update Released: June 30, 2020
RUN mkdir -p /opt/gcc && cd /opt/gcc \
&& 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 \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
&& rm -rf /opt/gcc/share/doc

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

# manual ccache setup for arm-none-eabi-g++/arm-none-eabi-gcc
RUN ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-g++ \
&& ln -s /usr/bin/ccache /usr/lib/ccache/arm-none-eabi-gcc

# nuttx tools
RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
&& cd /tmp/tools/kconfig-frontends \
Expand All @@ -47,3 +27,12 @@ RUN git clone --depth 1 https://bitbucket.org/nuttx/tools.git /tmp/tools \
RUN git clone --recursive https://github.com/google/bloaty.git /tmp/bloaty \
&& cd /tmp/bloaty && cmake -GNinja . && ninja -j $(nproc) bloaty && cp bloaty /usr/local/bin/ \
&& rm -rf /tmp/*

# cleanup
RUN rm -rf \
/var/lib/apt/lists/* \
/tmp/* /var/tmp/* \
/root/.cache \
/root/.gradle \
/root/.local