Skip to content

Commit

Permalink
feat: send docker image layers SHAs
Browse files Browse the repository at this point in the history
  • Loading branch information
orkamara committed Jan 8, 2019
1 parent ecac358 commit 0827c2e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/lib/snyk-test/run-test.ts
Expand Up @@ -172,11 +172,18 @@ async function assembleLocalPayload(root, options, policyLocations): Promise<Pay
if (_.get(inspectRes, 'plugin.packageManager')) {
options.packageManager = inspectRes.plugin.packageManager;
}
if (!_.get(pkg, 'docker.baseImage') && options['base-image']) {

const baseImageFromDockerfile = _.get(pkg, 'docker.baseImage');
if (!baseImageFromDockerfile && options['base-image']) {
pkg.docker = pkg.docker || {};
pkg.docker.baseImage = options['base-image'];
}

if (baseImageFromDockerfile && inspectRes.plugin.imageLayers) {
analytics.add('BaseImage', baseImageFromDockerfile);
analytics.add('imageLayers', inspectRes.plugin.imageLayers);
}

if (_.get(pkg, 'files.gemfileLock.contents')) {
const gemfileLockBase64 = pkg.files.gemfileLock.contents;
const gemfileLockContents = Buffer.from(gemfileLockBase64, 'base64').toString();
Expand Down

0 comments on commit 0827c2e

Please sign in to comment.