| 1 |
# Copyright 2017 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 |
FROM ossfuzz/base-builder |
| 18 |
MAINTAINER [email protected] |
| 19 |
RUN apt-get install -y \ |
| 20 |
cmake \ |
| 21 |
libuv1-dev |
| 22 |
# (optional) add vim |
| 23 |
|
| 24 |
# (optional) customize enviromental variables |
| 25 |
#ENV FUZZING_ENGINE |
| 26 |
#ENV SANITIZER_FLAGS |
| 27 |
|
| 28 |
# copy qpid-proton from filesystem into the container |
| 29 |
COPY . ./qpid-proton |
| 30 |
WORKDIR /src/qpid-proton |
| 31 |
|
| 32 |
# refresh the build directory if it exists already |
| 33 |
RUN rm build -rf || true |
| 34 |
|
| 35 |
# /usr/local/bin/compile compiles libFuzzer, then calls /src/build.sh |
| 36 |
# and sets correct environment variables for it |
| 37 |
RUN echo cmake .. -DCMAKE_BUILD_TYPE=Debug -DFUZZ_TEST=ON -DFUZZING_ENGINE=ON > /src/build.sh |
| 38 |
|
| 39 |
# build it |
| 40 |
RUN mkdir build |
| 41 |
WORKDIR /src/qpid-proton/build |
| 42 |
RUN /usr/local/bin/compile |
| 43 |
WORKDIR /src/qpid-proton/build/proton-c/src/tests/fuzz |
| 44 |
RUN make |
| 45 |
RUN ls |
| 46 |
|
| 47 |
# run corpus through fuzzer and irrespective of result start bash |
| 48 |
ENTRYPOINT make test; bash |