Difficulty: BeginnerTime: Approximately 15 minutes
docker scan
. This lab shows how it works.docker scan --login
and sign in to unlock 200 free scans per month.docker scan --version
, it should print the current version of docker scan and the Snyk engine version../build.sh
to build them all at once.-f
pointing at the Dockerfile.docker images
to list them out.docker scan
to scan for vulnerabilities. It's a best practice to pass the Dockerfile
used to build the image with --file
to get more robust results that include vulnerabilities from Dockerfile instruction and base image upgrade guidance. For example,Introduced by your base image
line. (Line 9 below)Introduced in your Dockerfile by
line. (Line 9)Target File
that introduced it. (Line 14)docker scan
, Snyk can suggest other Base Images that can be used in the Dockerfile's FROM
statement to bring down those vulnerability counts.Minor
upgrades are the most likely to be compatible with little work,Major
upgrades can introduce breaking changes depending on image usage,Alternative
architecture images are shown for more technical users to investigate.Minor
upgrade recommended by Snyk. Change the FROM statement in the Dockerfile:docker scan
to scan for vulnerabilities. Once again, pass the Dockerfile
used to build the image with --file
to get more robust results.