Permalink
Browse files

feat: send docker image layers SHAs

  • Loading branch information...
orkamara committed Jan 7, 2019
1 parent ecac358 commit 0827c2edecbb662559e858dae5604786b35fd96c
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/lib/snyk-test/run-test.ts
@@ -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();

0 comments on commit 0827c2e

Please sign in to comment.