# The image ClusterFuzzLite builds the fuzz targets in. The base image holds Node and the fuzzing tools. Dependabot keeps the digest current.
FROM gcr.io/oss-fuzz-base/base-builder-javascript@sha256:cdf6ee33dd590903eb6e223c8541b509a8ad38725cbf874e14d99ae8500e64b7
# Only what the targets load is copied in, named one by one, so nothing else in the repository can end up in the image. If a target starts to read
# another file, add it here: test/fuzz-targets.test.mjs runs every target from exactly these files and fails on the first one that is missing.
COPY lib $SRC/100x-engineer-skill/lib
COPY scripts $SRC/100x-engineer-skill/scripts
COPY skills $SRC/100x-engineer-skill/skills
COPY fuzz $SRC/100x-engineer-skill/fuzz
COPY .clusterfuzzlite $SRC/100x-engineer-skill/.clusterfuzzlite
COPY package.json $SRC/100x-engineer-skill/package.json
COPY .github/scorecard-policy.json .github/skills-audit-policy.json $SRC/100x-engineer-skill/.github/
COPY .clusterfuzzlite/build.sh $SRC/
WORKDIR $SRC/100x-engineer-skill

# The build says coverage (see .github/workflows/fuzz.yml), and a coverage build copies $SRC into the output, so that a coverage report can read the
# source. The honggfuzz tools in $SRC hold the word that marks a fuzz target, and the run step then takes them for targets and "finds" a crash in
# a compiler wrapper. Nothing here uses honggfuzz.
RUN rm -rf $SRC/honggfuzz
