Skip to content

Commit ed7e180

Browse files
[IDEA][WIP] Fix location of build scripts, define project meta-vars.
1 parent 537a5ed commit ed7e180

File tree

5 files changed

+49
-5
lines changed

5 files changed

+49
-5
lines changed

expat/Dockerfile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,7 @@ FROM ossfuzz/base-libfuzzer
1818
MAINTAINER mike.aizatsky@gmail.com
1919
RUN apt-get install -y make autoconf automake libtool docbook2x
2020

21-
CMD /src/oss-fuzz/expat/build.sh
21+
ENV GIT_CHECKOUT_DIR="expat"
22+
ENV GIT_URL="git://git.code.sf.net/p/expat/code_git"
23+
24+
COPY build.sh /src/

infra/base-images/base-libfuzzer/Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
FROM ossfuzz/base-clang
1818
MAINTAINER mike.aizatsky@gmail.com
19-
RUN apt-get install -y git libc6-dev
19+
RUN apt-get install -y git libc6-dev
2020

2121
RUN cd /src && git clone --depth 1 https://github.com/google/oss-fuzz.git
2222
VOLUME /src/oss-fuzz
@@ -33,5 +33,7 @@ ENV LDFLAGS "-Wl,-whole-archive /usr/local/lib/libc++.a /usr/local/lib/libc++abi
3333
RUN mkdir /out
3434
VOLUME /out
3535

36-
COPY run /
37-
ENTRYPOINT ["/run"]
36+
RUN mkdir /src/bin
37+
COPY compile checkout /src/bin/
38+
ENV PATH=/src/bin:$PATH
39+
CMD ["compile"]
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# base-libfuzzer
2+
================
3+
4+
*Abstract* base image for all libfuzzer builders.
5+
6+
Supported commands:
7+
8+
* `docker run -ti <image_name> [compile]` - compiles everything. Expects /src/ paths
9+
to be mounted.
10+
* `docker run -ti <image_name> checkout` - checks sources out automatically
11+
and compiles them.
12+
* `docker run -ti <image_name> /bin/bash` - drop into shell. Run `compile` script
13+
to start build.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash -eux
2+
# Copyright 2016 Google Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
################################################################################
17+
18+
cd /src
19+
20+
if [ -n "$GIT_CHECKOUT_DIR" ] ; then
21+
git clone $GIT_URL $GIT_CHECKOUT_DIR
22+
else
23+
git clone $GIT_URL
24+
fi
25+
26+
compile

infra/base-images/base-libfuzzer/run renamed to infra/base-images/base-libfuzzer/compile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,4 @@ echo "LDFLAGS=$LDFLAGS"
3636

3737
echo "---------------------------------------------------------------"
3838

39-
$*
39+
/src/build.sh

0 commit comments

Comments
 (0)