Skip to content
This repository has been archived by the owner on Jan 27, 2023. It is now read-only.

Commit

Permalink
Use OCI manifest from skopeo copy for analysis
Browse files Browse the repository at this point in the history
If layers are not compressed on the registry, skopeo copy will compress them
on the fly when executing "skopeo copy ... oci:dir".  That causes disparity
between image manifest that was previously fetched with "skopeo inspect",
which had references to uncompressed layers.

This change makes analysis rely on the OCI image manifest only.

Fixes #1080

Signed-off-by: Tero Saarni <tero.saarni@est.tech>
  • Loading branch information
tsaarni committed May 28, 2021
1 parent f25baa5 commit a02de84
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions anchore_engine/clients/localanchore_standalone.py
Original file line number Diff line number Diff line change
Expand Up @@ -1040,20 +1040,16 @@ def analyze_image(
rc = anchore_engine.clients.skopeo_wrapper.copy_image_from_docker_archive(
image_source_meta, staging_dirs["copydir"]
)

manifest = get_manifest_from_staging(staging_dirs)

manifest_data = json.loads(manifest)

if image_source != "docker-archive":
else:
rc = retrying_pull_image(
staging_dirs,
pullstring,
registry_creds=registry_creds,
manifest=manifest,
parent_manifest=parent_manifest,
)

manifest = get_manifest_from_staging(staging_dirs)
manifest_data = json.loads(manifest)

if manifest_data["schemaVersion"] == 1:
(
docker_history,
Expand Down

0 comments on commit a02de84

Please sign in to comment.