Closed mitchellh closed 3 years ago
Thank you!
@mitchellh I noticed that the capitalisation of json keys differs in your screenshot (snake_case in the root, CamelCase inside config
) vs the docker output you linked in #199 (CamelCase everywhere). Is that on purpose?
@mitchellh I noticed that the capitalisation of json keys differs in your screenshot (snake_case in the root, CamelCase inside
config
) vs the docker output you linked in #199 (CamelCase everywhere). Is that on purpose?
That is set by the OCI spec repository: https://pkg.go.dev/github.com/opencontainers/image-spec/specs-go/v1#Image (Somewhat oddly, they use lowercase on Image
but CamelCase on ImageConfig
🤷 ). I'm not purposely doing either.
I think since we're already not compatible with the Docker version, my opinion is that whatever OCI is enforcing is fine with me.
This CLI mimics
docker inspect
: it will print the OCI image config to stdout as raw JSON. This can be used withjq
or other tools to extract useful metadata about an image.Similar to
img pull
,img inspect
only takes one image (unlikedocker inspect
which can take multiple and outputs an array). I felt it was more important to act like img than it was to act like Docker.Tests included.
As for why? We're using
img
to do daemonless Docker builds but we need to do post-build inspection on the image. We used the Docker API previously for this (InspectImageWithRaw
) butimg
provides not alternative for us. It'd be great to have this information.Example:
(Note that the fact entrypoints and other stuff aren't visible in the above is showing the bug of #199 but that's wholly unrelated to this PR)