Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add indentation to raw manifests #2055

Open
GabriFedi97 opened this issue Feb 8, 2025 · 0 comments · May be fixed by #2056
Open

Enhancement: Add indentation to raw manifests #2055

GabriFedi97 opened this issue Feb 8, 2025 · 0 comments · May be fixed by #2056

Comments

@GabriFedi97
Copy link

Description

Currently the image manifests are generated as json objects without indentation. It would be useful to add the indentation to improve the readability once they are inspected remotely. Moreover, mutating an image manifest that has the indentation, which is a default aspect of images built by tools like buildkit, produces a manifest which doesn't have it.

Example

  1. Build a FROM scratch image with docker buildkit and push to a local registry.
  2. Inspect the manifest with crane manifest:
crane manifest localhost:5000/simple-manifest:latest

{
  "schemaVersion": 2,
  "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
  "config": {
    "mediaType": "application/vnd.docker.container.image.v1+json",
    "digest": "sha256:ea12cb742e0c435f825fddd7c246ac6773336a62550efd50501500ddf72eb581",
    "size": 894
  },
  "layers": null
}
  1. Mutate the manifest with crane mutate:
crane mutate localhost:5000/simple-manifest:latest

2025/02/08 12:46:02 pushed blob: sha256:701db07f8f291e50fbb06b4dd13310acad36c53120adbdf2568bd2009d48a2a3
2025/02/08 12:46:02 localhost:5000/simple-manifest:latest: digest: sha256:3a1223887a4b154965ef2168833b31b52677e230f22627f0d27ba9d1533f5b49 size: 266
localhost:5000/simple-manifest@sha256:3a1223887a4b154965ef2168833b31b52677e230f22627f0d27ba9d1533f5b49
  1. Inspect the manifest again with crane manifest:
crane manifest localhost:5000/simple-manifest:latest

{"schemaVersion":2,"mediaType":"application/vnd.docker.distribution.manifest.v2+json","config":{"mediaType":"application/vnd.docker.container.image.v1+json","size":897,"digest":"sha256:701db07f8f291e50fbb06b4dd13310acad36c53120adbdf2568bd2009d48a2a3"},"layers":null}
@GabriFedi97 GabriFedi97 linked a pull request Feb 8, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant