1# Copyright 2019 Google Inc. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14# 15################################################################################ 16FROM gcr.io/oss-fuzz-base/base-builder 17 18RUN apt-get update && \ 19 apt-get install -y \ 20 autoconf-archive \ 21 curl \ 22 libcmocka0 \ 23 libcmocka-dev \ 24 net-tools \ 25 build-essential \ 26 git \ 27 pkg-config \ 28 gcc \ 29 g++ \ 30 m4 \ 31 libtool \ 32 automake \ 33 libgcrypt20-dev \ 34 libssl-dev \ 35 autoconf \ 36 gnulib \ 37 wget \ 38 doxygen \ 39 libdbus-1-dev \ 40 libglib2.0-dev \ 41 clang-6.0 \ 42 clang-tools-6.0 \ 43 pandoc \ 44 lcov \ 45 libcurl4-openssl-dev \ 46 dbus-x11 \ 47 python-yaml \ 48 python3-yaml \ 49 vim-common \ 50 python3-pip \ 51 libsqlite3-dev \ 52 python-cryptography \ 53 python3-cryptography \ 54 acl 55 56RUN pip3 install cpp-coveralls 57 58RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-6.0 100 59RUN update-alternatives --install /usr/bin/scan-build scan-build /usr/bin/scan-build-6.0 100 60 61ARG autoconf_archive=autoconf-archive-2018.03.13 62WORKDIR /tmp 63RUN wget --quiet --show-progress --progress=dot:giga "http://mirror.kumi.systems/gnu/autoconf-archive/$autoconf_archive.tar.xz" \ 64 && tar -xf $autoconf_archive.tar.xz \ 65 && rm $autoconf_archive.tar.xz \ 66 && cd $autoconf_archive \ 67 && ./configure --prefix=/usr \ 68 && make -j $(nproc) && make install 69RUN rm -fr $autoconf_archive.tar.xz 70 71ARG ibmtpm_name=ibmtpm1119 72WORKDIR /tmp 73RUN wget --quiet --show-progress --progress=dot:giga "https://downloads.sourceforge.net/project/ibmswtpm2/$ibmtpm_name.tar.gz" \ 74 && sha256sum $ibmtpm_name.tar.gz | grep ^b9eef79904e276aeaed2a6b9e4021442ef4d7dfae4adde2473bef1a6a4cd10fb \ 75 && mkdir -p $ibmtpm_name \ 76 && tar xvf $ibmtpm_name.tar.gz -C $ibmtpm_name \ 77 && rm $ibmtpm_name.tar.gz 78WORKDIR $ibmtpm_name/src 79RUN CFLAGS="-I/usr/local/openssl/include" make -j$(nproc) \ 80&& cp tpm_server /usr/local/bin 81RUN rm -fr $ibmtpm_name/src $ibmtpm_name.tar.gz 82 83ARG uthash="2.1.0" 84WORKDIR /tmp 85RUN wget --quiet --show-progress --progress=dot:giga "https://github.com/troydhanson/uthash/archive/v${uthash}.tar.gz" \ 86 && tar -xf v${uthash}.tar.gz \ 87 && cp uthash-${uthash}/src/*.h /usr/include/ 88RUN rm -rf uthash-${uthash}/ v${uthash}.tar.gz 89 90RUN git clone --depth 1 \ 91 https://github.com/tpm2-software/tpm2-tss $SRC/tpm2-tss/ 92WORKDIR $SRC/tpm2-tss/ 93COPY build.sh $SRC/ 94