@snyk/snyk-docker-pull
Advanced tools
Comparing version 3.2.4 to 3.2.5
@@ -42,3 +42,3 @@ { | ||
"dependencies": { | ||
"@snyk/docker-registry-v2-client": "^2.1.1", | ||
"@snyk/docker-registry-v2-client": "^2.1.2", | ||
"child-process": "^1.0.2", | ||
@@ -48,3 +48,3 @@ "tar-stream": "^2.1.2", | ||
}, | ||
"version": "3.2.4" | ||
"version": "3.2.5" | ||
} |
@@ -93,2 +93,46 @@ import * as path from "path"; | ||
test.only("private multiarch manifest digest pull and build", async () => { | ||
const repo = `${process.env.SNYK_DRA_DOCKER_HUB_REPOSITORY}-multiarch`; | ||
const multiArchManifestDigestWithAmd64 = | ||
"sha256:5e2cb9c57eaef5ab6c99e7f7620ebf3c1c580928cf450e155e1b6306c6dd1939"; | ||
const opt: DockerPullOptions = { | ||
username: process.env.SNYK_DRA_DOCKER_HUB_USERNAME, | ||
password: process.env.SNYK_DRA_DOCKER_HUB_PASSWORD, | ||
loadImage: false | ||
}; | ||
// Add pull save request | ||
const pullSaveRequestPath = path.join(os.tmpdir(), "pullSaveRequest.json"); | ||
fs.writeFileSync( | ||
pullSaveRequestPath, | ||
`{ | ||
"foo" : { | ||
"username" : "${process.env.SNYK_DRA_DOCKER_HUB_USERNAME}", | ||
"repo" : "${repo}", | ||
"tag" : "${multiArchManifestDigestWithAmd64}" | ||
} | ||
}` | ||
); | ||
const dockerPull: DockerPull = new DockerPull(); | ||
const stagingDir = ( | ||
await dockerPull.pull( | ||
"registry-1.docker.io", | ||
repo, | ||
multiArchManifestDigestWithAmd64, | ||
opt | ||
) | ||
).stagingDir; | ||
const containerArchives = glob.sync(path.join(os.tmpdir(), "foo-*.tar")); | ||
expect(containerArchives.length).toBeGreaterThan(0); | ||
const tarPath = path.join(stagingDir.name, "image.tar"); | ||
expect(fs.existsSync(tarPath)).toBeTruthy(); | ||
stagingDir.removeCallback(); | ||
fs.unlinkSync(pullSaveRequestPath); | ||
}); | ||
test("pull from public repo", async () => { | ||
@@ -95,0 +139,0 @@ const registry = "registry-1.docker.io"; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
AI-detected potential security risk
Supply chain riskAI has determined that this package may contain potential security issues or vulnerabilities.
Found 1 instance in 1 package
44391
883
1
3