Skip to content

Commit f0dee42

Browse files
committed
apps: Preserve app image digest
Make `skopeo` preserve the original container image manifest so its hash matches the hash specified in its digest reference in an app compose project or in an image index. Signed-off-by: Mike Sul <mike.sul@foundries.io>
1 parent c7a4b8a commit f0dee42

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

apps/target_apps_fetcher.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,9 @@ def fetch_image(self, target_name: str, arch: str, image: str, dst_root_dir: str
183183
image_dir = os.path.join(dst_root_dir, uri.host, uri.name, uri.hash)
184184
os.makedirs(image_dir, exist_ok=True)
185185
subprocess.check_call(['skopeo', '--insecure-policy', '--override-arch', arch, 'copy',
186-
'--retry-times', '3', '--format', 'v2s2', '--dest-shared-blob-dir',
187-
self.blobs_dir(target_name), 'docker://' + image, 'oci:' + image_dir])
186+
'--preserve-digests', '--retry-times', '3', '--format', 'v2s2',
187+
'--dest-shared-blob-dir', self.blobs_dir(target_name),
188+
'docker://' + image, 'oci:' + image_dir])
188189

189190
# Store the image manifest in the blob directory, as result it contains all blobs/nodes of
190191
# the app's merkle tree. It allows to check app integrity on devices with preloaded apps and

0 commit comments

Comments
 (0)