diff --git a/docker/Dockerfile_base-bionic b/docker/Dockerfile_base-bionic index cd8eb353..ab0a5825 100644 --- a/docker/Dockerfile_base-bionic +++ b/docker/Dockerfile_base-bionic @@ -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 \ @@ -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 diff --git a/docker/Dockerfile_base-focal b/docker/Dockerfile_base-focal index 8d6e41dd..809bd842 100644 --- a/docker/Dockerfile_base-focal +++ b/docker/Dockerfile_base-focal @@ -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 \ @@ -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 diff --git a/docker/Dockerfile_nuttx-bionic b/docker/Dockerfile_nuttx-bionic index f8036339..50a5a0d8 100644 --- a/docker/Dockerfile_nuttx-bionic +++ b/docker/Dockerfile_nuttx-bionic @@ -5,37 +5,17 @@ FROM px4io/px4-dev-base-bionic:2020-06-28 LABEL maintainer="Daniel Agar " -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 \ @@ -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 + diff --git a/docker/Dockerfile_nuttx-focal b/docker/Dockerfile_nuttx-focal index 121fe708..a479f712 100644 --- a/docker/Dockerfile_nuttx-focal +++ b/docker/Dockerfile_nuttx-focal @@ -5,37 +5,17 @@ FROM px4io/px4-dev-base-focal:2020-06-28 LABEL maintainer="Daniel Agar " -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 \ @@ -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 +