diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6a28dd6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM golang:latest + +RUN go install github.com/visma-prodsec/confused@latest +ENTRYPOINT ["confused"] diff --git a/README.md b/README.md index 5e749b6..77d0582 100644 --- a/README.md +++ b/README.md @@ -91,3 +91,17 @@ Issues found, the following packages are not available in public package reposit [!] internal/_package2 ``` + +## Docker version +### Build container +``` +docker build . -t confused +cd /directory/to/test +docker run --rm -v "$(pwd):/src" confused -l npm /src/package.json +``` + +### Scanning package.json and pom.xml in projects with multiple subdirectories +``` +find . -name package.json -exec bash -c 'cd "$(dirname {})" && echo "testing {}" && docker run --rm -v "$(pwd):/src" confused -l npm /src/package.json' \; +find . -name pom.xml -exec bash -c 'cd "$(dirname {})" && echo "testing {}" && docker run --rm -v "$(pwd):/src" confused -l mvn /src/pom.xml' \; +```