1# This docker container can be used to run all the TFLM CI checks.
2#
3# It is only used as part of the GitHub workflows to test for code-style. But
4# the container is available and ready for use to run all the checks locally,
5# in case that is useful for debugging.
6#
7# docker build -f ci/Dockerfile.micro -t ghcr.io/tflm-bot/tflm-ci:latest .
8#    or
9# docker pull ghcr.io/tflm-bot/tflm-ci:latest
10#
11# Use a prebuilt Python image instead of base Ubuntu to speed up the build process,
12# since it has all the build dependencies we need for Micro and downloads much faster
13# than the install process.
14FROM python:3.9.0-buster
15
16RUN echo deb http://apt.llvm.org/buster/ llvm-toolchain-buster-12 main > /etc/apt/sources.list.d/llvm.list
17RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
18
19RUN apt-get update
20
21RUN apt-get install -y zip xxd sudo
22
23RUN apt-get install -y clang-12 clang-format-12
24# Set clang-12 and clang-format-12 as the default to ensure that the pigweed
25# formatting scripts use the desired version.
26RUN ln -s /usr/bin/clang-12 /usr/bin/clang
27RUN ln -s /usr/bin/clang++-12 /usr/bin/clang++
28RUN ln -s /usr/bin/clang-format-12 /usr/bin/clang-format
29
30# Install yapf to check for Python formatting as part of the TFLM continuous
31# integration.
32RUN pip install yapf
33
34RUN pip install six
35
36# Install Renode test dependencies
37RUN pip install pyyaml requests psutil robotframework==3.1
38
39COPY ci/*.sh /install/
40RUN /install/install_bazel.sh
41RUN /install/install_buildifier.sh
42