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################################################################################ 16 17FROM gcr.io/oss-fuzz-base/base-builder-rust 18 19RUN apt-get --yes update \ 20 && apt-get install --no-install-recommends --yes \ 21 libssl-dev \ 22 pkg-config \ 23 python \ 24 && apt-get clean \ 25 && rm --recursive --force /var/lib/apt/lists/* 26 27# Install WebAssembly target for Rust. 28RUN rustup target add wasm32-unknown-unknown 29 30# Install Protobuf compiler. 31ARG protobuf_version=3.13.0 32ARG protobuf_sha256=4a3b26d1ebb9c1d23e933694a6669295f6a39ddc64c3db2adf671f0a6026f82e 33ARG protobuf_dir=/usr/local/protobuf 34ARG protobuf_temp=/tmp/protobuf.zip 35ENV PATH "${protobuf_dir}/bin:${PATH}" 36RUN curl --location https://github.com/protocolbuffers/protobuf/releases/download/v${protobuf_version}/protoc-${protobuf_version}-linux-x86_64.zip > ${protobuf_temp} \ 37 && sha256sum --binary ${protobuf_temp} && echo "${protobuf_sha256} *${protobuf_temp}" | sha256sum --check \ 38 && unzip ${protobuf_temp} -d ${protobuf_dir} \ 39 && rm ${protobuf_temp} \ 40 && chmod --recursive a+rwx ${protobuf_dir} \ 41 && protoc --version 42 43RUN git clone --depth 1 https://github.com/project-oak/oak oak 44 45WORKDIR oak 46COPY build.sh $SRC/ 47COPY rustc.py $SRC/ 48