Problem:
When trying to run a snyk docker container an error comes up in the output:
docker run --rm -v C:\project\src:/project -e SNYK_TOKEN=<<token>> snyk/snyk-cli:nuget test
Output will be something like (note the first line):
parse error: Invalid numeric literal at line 2, column 8
Testing /project...
Organization: cool-org
Package manager: nuget
Target file: obj/project.assets.json
Project name: project
Open source: no
Project path: /project
Licenses: enabled
✓ Tested 0 dependencies for known issues, no vulnerable paths found.
Next steps:
- Run `snyk monitor` to be notified about new related vulnerabilities.
- Run `snyk test` as part of your CI/test.
Discussion:
Docker containers were originally created for the Jenkins CI pipeline which uses JSON output to create a set of results files including a JSON file in the host volume folder.
The entrypoint shell script in the docker container requires the snyk output to be in JSON format and is parsed by jq
in the image.
Typically, the command that is run in a Jenkins pipeline also uses the --json
argument.
Resolution:
This error can be ignored but if problems arise, the solution is to add the --json
argument to the command line.