I'm using BlackDuck scanning use script detect.sh from Synopsys to scan docker image but I don't know how to scan path in docker image. My setting below:
./detect.sh \
--blackduck.url=https://blackduck.blackducksoftware.com \
--blackduck.always.trust.cert=true \
--blackduck.trust.cert=true \
--blackduck.api.token=\"%env.BD_HUB_TOKEN%\" \
--detect.project.name=\"%black_duck_parent_project%\" \
--detect.project.version.name="Docker-Image" \
--detect.code.location.name="Docker-Image-Scan" \
--detect.tools.excluded=DETECTOR \
--logging.level.com.synopsys.integration=DEBUG \
--detect.detector.search.depth=10000 \
--detect.docker.image=myapp:latest \
--detect.project.codelocation.unmap=true \
--detect.output.path=.\blackduck \
--detect.detector.search.exclusion.defaults=true \
--detect.policy.check.fail.on.severities=BLOCKER,CRITICAL \
--logging.level.com.synopsys=DEBUG \
--detect.report.timeout=1200 \
--blackduck.timeout=240
I want to scan directory /opt/scanning, /opt/checking in my docker image.
How to scan that folder?
From the Advanced BackDuck Docker Inspector documentation:
curl -O https://raw.githubusercontent.com/blackducksoftware/blackduck-docker-inspector/master/deployment/docker/runDetectInImageDir/runDetectInImageDir.sh
curl -O https://raw.githubusercontent.com/blackducksoftware/blackduck-docker-inspector/master/deployment/docker/runDetectInImageDir/Dockerfile
runDetectInImageDir.sh
contains the following script, which "provides a simple illustration of how you might run detect on a specific directory (say, a maven project) within an image, without running that image as a container":Make sure you read the instructions in the sample files! Of course, amongst others, you have to replace
image_mavenproject_v_1/home/my-app
by your path.