STT-tensorflow/tensorflow/tools/ci_build/Dockerfile.micro
Advait Jain c21a146b96 Fix clang-format installation on the TFLM Docker container.
The TFLM CI is currently failing with the following error message:
```
The following packages have unmet dependencies:
 clang : Depends: clang-12 (>= 12~) but it is not installable
 clang-format : Depends: clang-format-12 (>= 12~) but it is not installable
E: Unable to correct problems, you have held broken packages.
The command '/bin/sh -c apt-get install -y clang clang-format' returned a non-zero code: 100
```

This changes ensures that we download a specific version of clang. We can still
upgrade if there is a new release, but that should be deliberate instead of
breaking the CI.

PiperOrigin-RevId: 354953821
Change-Id: I693ffef2975a116ffac8f27c409cd5ca7f527790
2021-02-01 09:21:49 -08:00

31 lines
1.2 KiB
Docker

# Use a prebuilt Python image instead of base Ubuntu to speed up the build process,
# since it has all the build dependencies we need for Micro and downloads much faster
# than the install process.
FROM python:3.9.0-buster
LABEL maintainer="Pete Warden <petewarden@google.com>"
RUN echo deb http://apt.llvm.org/buster/ llvm-toolchain-buster-12 main > /etc/apt/sources.list.d/llvm.list
RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
RUN apt-get update
RUN apt-get install -y zip xxd sudo
RUN apt-get install -y clang-12 clang-format-12
# Set clang-12 and clang-format-12 as the default to ensure that the pigweed
# formatting scripts use the desired version.
RUN ln -s /usr/bin/clang-12 /usr/bin/clang
RUN ln -s /usr/bin/clang++-12 /usr/bin/clang++
RUN ln -s /usr/bin/clang-format-12 /usr/bin/clang-format
RUN pip install six
# Install Renode test dependencies
RUN pip install pyyaml requests psutil robotframework==3.1
# Install bazel and buildifier so that the bazel presubmit checks can be run
# from the micro docker container and are consistent with the rest of the CI.
COPY install/*.sh /install/
RUN /install/install_bazel.sh
RUN /install/install_buildifier.sh