Skip to content

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 anchore#1080

Signed-off-by: Tero Saarni <[email protected]>
  • Loading branch information
tsaarni committed Jul 30, 2021
1 parent 5a5c492 commit 0616f23
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 @@ -1047,20 +1047,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 0616f23

Please sign in to comment.