| # start with Ubuntu 20.04LTS |
| FROM ubuntu:focal |
| |
| VOLUME "/var/source" |
| |
| # base build and check tools and libraries layer |
| RUN set -x \ |
| && apt-get update \ |
| && DEBIAN_FRONTEND=noninteractive apt-get install -fy \ |
| autoconf \ |
| automake \ |
| bison \ |
| bridge-utils \ |
| clang \ |
| clang-format \ |
| clang-tidy \ |
| curl \ |
| flex \ |
| g++ \ |
| git \ |
| gperf \ |
| iproute2 \ |
| jq \ |
| lcov \ |
| libavahi-client-dev \ |
| libavahi-common-dev \ |
| libcairo2-dev \ |
| libdbus-1-dev \ |
| libdbus-glib-1-dev \ |
| libgif-dev \ |
| libglib2.0-dev \ |
| libical-dev \ |
| libjpeg-dev \ |
| libdmalloc-dev \ |
| libmbedtls-dev \ |
| libncurses5-dev \ |
| libncursesw5-dev \ |
| libnspr4-dev \ |
| libpango1.0-dev \ |
| libpixman-1-dev \ |
| libreadline-dev \ |
| libssl-dev \ |
| libtool \ |
| libudev-dev \ |
| libusb-1.0-0 \ |
| libusb-dev \ |
| libxml2-dev \ |
| make \ |
| net-tools \ |
| ninja-build \ |
| openjdk-8-jdk \ |
| pkg-config \ |
| python3.9 \ |
| python3.9-dev \ |
| python3.9-venv \ |
| rsync \ |
| shellcheck \ |
| strace \ |
| systemd \ |
| udev \ |
| unzip \ |
| wget \ |
| git-lfs \ |
| zlib1g-dev \ |
| && rm -rf /var/lib/apt/lists/ \ |
| && git lfs install \ |
| && : # last line |
| |
| # Cmake (Mbed OS requires >=3.19.0-rc3 version which is not available in Ubuntu 20.04 repository) |
| RUN set -x \ |
| && (cd /tmp \ |
| && wget --progress=dot:giga https://github.com/Kitware/CMake/releases/download/v3.19.3/cmake-3.19.3-Linux-x86_64.sh \ |
| && sh cmake-3.19.3-Linux-x86_64.sh --exclude-subdir --prefix=/usr/local \ |
| && rm -rf cmake-3.19.3-Linux-x86_64.sh) \ |
| && exec bash \ |
| && : # last line |
| |
| # Python 3.9 and PIP |
| RUN set -x \ |
| && DEBIAN_FRONTEND=noninteractive apt-get update \ |
| && DEBIAN_FRONTEND=noninteractive apt-get install -y libgirepository1.0-dev \ |
| && DEBIAN_FRONTEND=noninteractive apt-get install -y software-properties-common \ |
| && add-apt-repository universe \ |
| && curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py \ |
| && python3.9 get-pip.py \ |
| && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1 \ |
| && rm -rf /var/lib/apt/lists/ \ |
| && : # last line |
| |
| RUN set -x \ |
| && pip3 install attrs coloredlogs PyGithub pygit future portpicker mobly click cxxfilt ghapi pandas tabulate \ |
| && : # last line |
| |
| # build and install gn |
| RUN set -x \ |
| && git clone https://gn.googlesource.com/gn \ |
| && cd gn \ |
| && python3 build/gen.py \ |
| && ninja -C out \ |
| && cp out/gn /usr/local/bin \ |
| && cd .. \ |
| && rm -rf gn \ |
| && : # last line |
| |
| # Install bloat comparison tools |
| RUN set -x \ |
| && git clone https://github.com/google/bloaty.git \ |
| && mkdir -p bloaty/build \ |
| && cd bloaty/build \ |
| && cmake ../ \ |
| && make -j8 \ |
| && make install \ |
| && cd ../.. \ |
| && rm -rf bloaty \ |
| && : # last line |
| |
| # NodeJS: install a newer version than what apt-get would read |
| # This installs the latest LTS version of nodejs |
| ENV CHIP_NODE_VERSION=v16.13.2 |
| RUN set -x \ |
| && mkdir node_js \ |
| && cd node_js \ |
| && wget https://nodejs.org/dist/$CHIP_NODE_VERSION/node-$CHIP_NODE_VERSION-linux-x64.tar.xz \ |
| && tar xfvJ node-$CHIP_NODE_VERSION-linux-x64.tar.xz \ |
| && mv node-$CHIP_NODE_VERSION-linux-x64 /opt/ \ |
| && ln -s /opt/node-$CHIP_NODE_VERSION-linux-x64 /opt/node \ |
| && ln -s /opt/node/bin/* /usr/bin \ |
| && cd .. \ |
| && rm -rf node_js \ |
| && : # last line |