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
17# TODO(https://github.com/google/oss-fuzz/issues/3093): Stop specifying the
18# image SHA once the bug is fixed.
19FROM gcr.io/oss-fuzz-base/base-builder@sha256:276813aef0ce5972db43c0230f96162003994fa742fb1b2f4e66c67498575c65
20
21# Use a fixed Bazel version.
22# https://github.com/google/asylo/blob/088ea3490dd4579655bd5b65b0e31fe18de7f6dd/asylo/distrib/toolchain/Dockerfile#L48-L71
23ARG bazel_version=1.1.0
24ARG bazel_sha=138b47ffd54924e3c0264c65d31d3927803fb9025db4d5b18107df79ee3bda95
25ARG bazel_url=https://storage.googleapis.com/bazel-apt/pool/jdk1.8/b/bazel/bazel_${bazel_version}_amd64.deb
26
27# Install Bazel.
28RUN apt-get update && \
29    apt-get install -y wget && \
30    wget "${bazel_url}" -nv -o- -O bazel.deb && \
31    echo "${bazel_sha}  bazel.deb" > bazel.sha256 && \
32    sha256sum --check bazel.sha256 && \
33    apt-get install -y ./bazel.deb && \
34    rm bazel.deb bazel.sha256 && \
35    apt-get clean
36
37RUN git clone --depth 1 https://github.com/project-oak/oak oak
38WORKDIR oak
39COPY build.sh $SRC/
40